Skip to content

Commit 5ef58e2

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: "Two minor fixes: one to update a Kconfig reference and the other to fix a resource leak on an error path in sg" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: Update referenced link to cdrtools scsi: sg: add sg_remove_request in sg_write
2 parents 8e9ccd0 + fa17a6d commit 5ef58e2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/scsi/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ config CHR_DEV_SG
127127

128128
For scanners, look at SANE (<http://www.sane-project.org/>). For CD
129129
writer software look at Cdrtools
130-
(<http://cdrecord.berlios.de/private/cdrecord.html>)
130+
(<http://cdrtools.sourceforge.net/>)
131131
and for burning a "disk at once": CDRDAO
132132
(<http://cdrdao.sourceforge.net/>). Cdparanoia is a high
133133
quality digital reader of audio CDs (<http://www.xiph.org/paranoia/>).

drivers/scsi/sg.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,10 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
685685
hp->flags = input_size; /* structure abuse ... */
686686
hp->pack_id = old_hdr.pack_id;
687687
hp->usr_ptr = NULL;
688-
if (copy_from_user(cmnd, buf, cmd_size))
688+
if (copy_from_user(cmnd, buf, cmd_size)) {
689+
sg_remove_request(sfp, srp);
689690
return -EFAULT;
691+
}
690692
/*
691693
* SG_DXFER_TO_FROM_DEV is functionally equivalent to SG_DXFER_FROM_DEV,
692694
* but is is possible that the app intended SG_DXFER_TO_DEV, because there

0 commit comments

Comments
 (0)