summaryrefslogtreecommitdiff
path: root/block/scsi_ioctl.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-11-17 22:16:03 +0100
committerTakashi Iwai <tiwai@suse.de>2014-11-17 22:16:03 +0100
commit39ae97ea4b773be81bae9eec08ed1e5c53606c1a (patch)
tree4d55635fb46a86b970c1491cc529eb2770bf3076 /block/scsi_ioctl.c
parenta358a0ef861dae6f8330fb034aaa43adae71ebc1 (diff)
parentcf9a7f7823c67243da44da2ac47ca944a3108282 (diff)
Merge tag 'asoc-v3.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.18 As well as the usual driver fixes there's a few other things here: One is a fix for a race in DPCM which is unfortuantely a rather large diffstat, this is the result of growing usage of the mainline code and hence more detailed testing so I'm relatively happy. The other is a fix for non-DT machine driver matching following some of the componentization work which is much more focused. Both have had a while to cook in -next.
Diffstat (limited to 'block/scsi_ioctl.c')
-rw-r--r--block/scsi_ioctl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index abb2e65b24cc..b0c2a616c8f9 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -458,7 +458,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
rq = blk_get_request(q, in_len ? WRITE : READ, __GFP_WAIT);
if (IS_ERR(rq)) {
err = PTR_ERR(rq);
- goto error;
+ goto error_free_buffer;
}
blk_rq_set_block_pc(rq);
@@ -508,7 +508,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, __GFP_WAIT)) {
err = DRIVER_ERROR << 24;
- goto out;
+ goto error;
}
memset(sense, 0, sizeof(sense));
@@ -517,7 +517,6 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
blk_execute_rq(q, disk, rq, 0);
-out:
err = rq->errors & 0xff; /* only 8 bit SCSI status */
if (err) {
if (rq->sense_len && rq->sense) {
@@ -532,9 +531,11 @@ out:
}
error:
+ blk_put_request(rq);
+
+error_free_buffer:
kfree(buffer);
- if (rq)
- blk_put_request(rq);
+
return err;
}
EXPORT_SYMBOL_GPL(sg_scsi_ioctl);