Ignore:
Timestamp:
Apr 21, 2017, 4:28:29 AM (5 weeks ago)
Author:
brainslayer
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/drivers/scsi/sr.c

    r31574 r31885  
    834834        struct scsi_mode_data data;
    835835        struct scsi_sense_hdr sshdr;
     836        unsigned int ms_len = 128;
    836837        int rc, n;
    837838
     
    860861
    861862        /* ask for mode page 0x2a */
    862         rc = scsi_mode_sense(cd->device, 0, 0x2a, buffer, 128,
     863        rc = scsi_mode_sense(cd->device, 0, 0x2a, buffer, ms_len,
    863864                             SR_TIMEOUT, 3, &data, NULL);
    864865
    865         if (!scsi_status_is_good(rc)) {
     866        if (!scsi_status_is_good(rc) || data.length > ms_len ||
     867            data.header_length + data.block_descriptor_length > data.length) {
    866868                /* failed, drive doesn't have capabilities mode page */
    867869                cd->cdi.speed = 1;
Note: See TracChangeset for help on using the changeset viewer.