projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[SCSI] sg: fix bio leak with a detached device
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
scsi
/
sg.c
diff --git
a/drivers/scsi/sg.c
b/drivers/scsi/sg.c
index ef752b248c4d5ef7842589299d75a2297ec8178e..d4549092400ce3328d29df047238b0a057f182d2 100644
(file)
--- a/
drivers/scsi/sg.c
+++ b/
drivers/scsi/sg.c
@@
-729,6
+729,8
@@
sg_common_write(Sg_fd * sfp, Sg_request * srp,
return k; /* probably out of space --> ENOMEM */
}
if (sdp->detached) {
+ if (srp->bio)
+ blk_end_request_all(srp->rq, -EIO);
sg_finish_rem_req(srp);
return -ENODEV;
}