aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-04 21:41:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-04 21:41:40 -0500
commitc12f83c3099c4dd73fe721409d2ce18ca79a753d (patch)
tree3c81b4400d9f281e210eb725d7f5f5779bdf7246 /drivers
parentfab3e94a624f6ac6c4d8b8dc027bb03818a6cf1b (diff)
parent21b81716c6bff24cda52dc75588455f879ddbfe9 (diff)
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Two fairly simple fixes. One is a regression with ipr firmware loading caused by one of the trivial patches in the last merge window which failed to strip the \n from the file name string, so now the firmware loader no longer works leading to a lot of unhappy ipr users; fix by stripping the \n. The second is a memory leak within SCSI: the BLK_PREP_INVALID state was introduced a recent fix but we forgot to account for it correctly when freeing state, resulting in memory leakage. Add the correct state freeing in scsi_prep_return()" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: ipr: Fix regression when loading firmware SCSI: Free resources when we return BLKPREP_INVALID
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/ipr.c5
-rw-r--r--drivers/scsi/scsi_lib.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 3b3e0998fa6e..d6a691e27d33 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -4002,6 +4002,7 @@ static ssize_t ipr_store_update_fw(struct device *dev,
4002 struct ipr_sglist *sglist; 4002 struct ipr_sglist *sglist;
4003 char fname[100]; 4003 char fname[100];
4004 char *src; 4004 char *src;
4005 char *endline;
4005 int result, dnld_size; 4006 int result, dnld_size;
4006 4007
4007 if (!capable(CAP_SYS_ADMIN)) 4008 if (!capable(CAP_SYS_ADMIN))
@@ -4009,6 +4010,10 @@ static ssize_t ipr_store_update_fw(struct device *dev,
4009 4010
4010 snprintf(fname, sizeof(fname), "%s", buf); 4011 snprintf(fname, sizeof(fname), "%s", buf);
4011 4012
4013 endline = strchr(fname, '\n');
4014 if (endline)
4015 *endline = '\0';
4016
4012 if (request_firmware(&fw_entry, fname, &ioa_cfg->pdev->dev)) { 4017 if (request_firmware(&fw_entry, fname, &ioa_cfg->pdev->dev)) {
4013 dev_err(&ioa_cfg->pdev->dev, "Firmware file %s not found\n", fname); 4018 dev_err(&ioa_cfg->pdev->dev, "Firmware file %s not found\n", fname);
4014 return -EIO; 4019 return -EIO;
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index fa6b2c4eb7a2..8c6e31874171 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1344,6 +1344,7 @@ scsi_prep_return(struct request_queue *q, struct request *req, int ret)
1344 1344
1345 switch (ret) { 1345 switch (ret) {
1346 case BLKPREP_KILL: 1346 case BLKPREP_KILL:
1347 case BLKPREP_INVALID:
1347 req->errors = DID_NO_CONNECT << 16; 1348 req->errors = DID_NO_CONNECT << 16;
1348 /* release the command and kill it */ 1349 /* release the command and kill it */
1349 if (req->special) { 1350 if (req->special) {