Skip to content

Commit 770b0ff

Browse files
committed
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
2 parents 6a2fcc5 + 4f9eedf commit 770b0ff

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

drivers/scsi/aacraid/comminit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,13 +642,15 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
642642

643643
if (aac_comm_init(dev)<0){
644644
kfree(dev->queues);
645+
dev->queues = NULL;
645646
return NULL;
646647
}
647648
/*
648649
* Initialize the list of fibs
649650
*/
650651
if (aac_fib_setup(dev) < 0) {
651652
kfree(dev->queues);
653+
dev->queues = NULL;
652654
return NULL;
653655
}
654656

drivers/scsi/lpfc/lpfc_bsg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5410,7 +5410,7 @@ lpfc_get_cgnbuf_info(struct bsg_job *job)
54105410
struct get_cgnbuf_info_req *cgnbuf_req;
54115411
struct lpfc_cgn_info *cp;
54125412
uint8_t *cgn_buff;
5413-
int size, cinfosz;
5413+
size_t size, cinfosz;
54145414
int rc = 0;
54155415

54165416
if (job->request_len < sizeof(struct fc_bsg_request) +

drivers/scsi/sd.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,13 +1823,15 @@ static int sd_sync_cache(struct scsi_disk *sdkp)
18231823
(sshdr.asc == 0x74 && sshdr.ascq == 0x71)) /* drive is password locked */
18241824
/* this is no error here */
18251825
return 0;
1826+
18261827
/*
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.
18311832
*/
1832-
if (sshdr.sense_key == ILLEGAL_REQUEST)
1833+
if ((sshdr.asc == 0x04 && sshdr.ascq == 0x04) ||
1834+
sshdr.sense_key == ILLEGAL_REQUEST)
18331835
return 0;
18341836
}
18351837

0 commit comments

Comments
 (0)