If thre aren't any components, then the component[0] is beyond the end of the array. Reported-by: "Berry Cheng 程君(成淼)" <chengmiao.cj@xxxxxxxxxxxxxxx> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index ff474c7..a31114d 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -780,7 +780,8 @@ static void ses_intf_remove_enclosure(struct scsi_device *sdev) kfree(ses_dev->page2); kfree(ses_dev); - kfree(edev->component[0].scratch); + if (edev->components) + kfree(edev->component[0].scratch); put_device(&edev->edev); enclosure_unregister(edev); -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html