Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Minor fixes only.

The sd.c one ignores a sync cache request if format is in progress
which can happen if formatting a drive across suspend/resume"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: sd: Ignore command SYNCHRONIZE CACHE error if format in progress
scsi: aacraid: Fix double-free on probe failure
scsi: lpfc: Fix overflow build issue

+10 -6
+2
drivers/scsi/aacraid/comminit.c
··· 642 642 643 643 if (aac_comm_init(dev)<0){ 644 644 kfree(dev->queues); 645 + dev->queues = NULL; 645 646 return NULL; 646 647 } 647 648 /* ··· 650 649 */ 651 650 if (aac_fib_setup(dev) < 0) { 652 651 kfree(dev->queues); 652 + dev->queues = NULL; 653 653 return NULL; 654 654 } 655 655
+1 -1
drivers/scsi/lpfc/lpfc_bsg.c
··· 5410 5410 struct get_cgnbuf_info_req *cgnbuf_req; 5411 5411 struct lpfc_cgn_info *cp; 5412 5412 uint8_t *cgn_buff; 5413 - int size, cinfosz; 5413 + size_t size, cinfosz; 5414 5414 int rc = 0; 5415 5415 5416 5416 if (job->request_len < sizeof(struct fc_bsg_request) +
+7 -5
drivers/scsi/sd.c
··· 1823 1823 (sshdr.asc == 0x74 && sshdr.ascq == 0x71)) /* drive is password locked */ 1824 1824 /* this is no error here */ 1825 1825 return 0; 1826 + 1826 1827 /* 1827 - * This drive doesn't support sync and there's not much 1828 - * we can do because this is called during shutdown 1829 - * or suspend so just return success so those operations 1830 - * can proceed. 1828 + * If a format is in progress or if the drive does not 1829 + * support sync, there is not much we can do because 1830 + * this is called during shutdown or suspend so just 1831 + * return success so those operations can proceed. 1831 1832 */ 1832 - if (sshdr.sense_key == ILLEGAL_REQUEST) 1833 + if ((sshdr.asc == 0x04 && sshdr.ascq == 0x04) || 1834 + sshdr.sense_key == ILLEGAL_REQUEST) 1833 1835 return 0; 1834 1836 } 1835 1837