hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9K8D1 CVE: NA
--------------------------------
This reverts commit b9b8b793401cab3c8866bb73b2ce0045458e43af.
Commit b9b8b793401c ("scsi: ses: Handle enclosure with just a primary component gracefully") tried to apply commit 176d7345b89c from stable. However, it lost most of the changes without any descriptions. Revert it and reapply the patch from stable later.
Signed-off-by: Li Lingfeng lilingfeng3@huawei.com --- drivers/scsi/ses.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index 6b50d9cdb149..77f4322e2f71 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -728,6 +728,11 @@ static int ses_intf_add(struct device *cdev, components += type_ptr[1]; }
+ if (components == 0) { + sdev_printk(KERN_WARNING, sdev, "enclosure has no enumerated components\n"); + goto err_free; + } + ses_dev->page1 = buf; ses_dev->page1_len = len; buf = NULL;