diff options
-rw-r--r-- | drivers/scsi/ses.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index 869ca9c7f23f..034d605c3076 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -609,9 +609,11 @@ static void ses_enclosure_data_process(struct enclosure_device *edev, /* these elements are optional */ type_ptr[0] == ENCLOSURE_COMPONENT_SCSI_TARGET_PORT || type_ptr[0] == ENCLOSURE_COMPONENT_SCSI_INITIATOR_PORT || - type_ptr[0] == ENCLOSURE_COMPONENT_CONTROLLER_ELECTRONICS)) + type_ptr[0] == ENCLOSURE_COMPONENT_CONTROLLER_ELECTRONICS)) { addl_desc_ptr += addl_desc_ptr[1] + 2; - + if (addl_desc_ptr + 1 >= ses_dev->page10 + ses_dev->page10_len) + addl_desc_ptr = NULL; + } } } kfree(buf); |