aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-05-07 05:17:13 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-07 05:17:34 -0400
commit44347d947f628060b92449702071bfe1d31dfb75 (patch)
treec6ed74610d5b3295df4296659f80f5feb94b28cc /drivers/scsi/sg.c
parentd94fc523f3c35bd8013f04827e94756cbc0212f4 (diff)
parent413f81eba35d6ede9289b0c8a920c013a84fac71 (diff)
Merge branch 'linus' into tracing/core
Merge reason: tracing/core was on a .30-rc1 base and was missing out on on a handful of tracing fixes present in .30-rc5-almost. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 49c98730bb8d..91e316fe6522 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -179,7 +179,7 @@ typedef struct sg_device { /* holds the state of each scsi generic device */
179/* tasklet or soft irq callback */ 179/* tasklet or soft irq callback */
180static void sg_rq_end_io(struct request *rq, int uptodate); 180static void sg_rq_end_io(struct request *rq, int uptodate);
181static int sg_start_req(Sg_request *srp, unsigned char *cmd); 181static int sg_start_req(Sg_request *srp, unsigned char *cmd);
182static void sg_finish_rem_req(Sg_request * srp); 182static int sg_finish_rem_req(Sg_request * srp);
183static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size); 183static int sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size);
184static ssize_t sg_new_read(Sg_fd * sfp, char __user *buf, size_t count, 184static ssize_t sg_new_read(Sg_fd * sfp, char __user *buf, size_t count,
185 Sg_request * srp); 185 Sg_request * srp);
@@ -518,7 +518,7 @@ sg_new_read(Sg_fd * sfp, char __user *buf, size_t count, Sg_request * srp)
518 goto err_out; 518 goto err_out;
519 } 519 }
520err_out: 520err_out:
521 sg_finish_rem_req(srp); 521 err = sg_finish_rem_req(srp);
522 return (0 == err) ? count : err; 522 return (0 == err) ? count : err;
523} 523}
524 524
@@ -1697,9 +1697,10 @@ static int sg_start_req(Sg_request *srp, unsigned char *cmd)
1697 return res; 1697 return res;
1698} 1698}
1699 1699
1700static void 1700static int sg_finish_rem_req(Sg_request * srp)
1701sg_finish_rem_req(Sg_request * srp)
1702{ 1701{
1702 int ret = 0;
1703
1703 Sg_fd *sfp = srp->parentfp; 1704 Sg_fd *sfp = srp->parentfp;
1704 Sg_scatter_hold *req_schp = &srp->data; 1705 Sg_scatter_hold *req_schp = &srp->data;
1705 1706
@@ -1711,12 +1712,14 @@ sg_finish_rem_req(Sg_request * srp)
1711 1712
1712 if (srp->rq) { 1713 if (srp->rq) {
1713 if (srp->bio) 1714 if (srp->bio)
1714 blk_rq_unmap_user(srp->bio); 1715 ret = blk_rq_unmap_user(srp->bio);
1715 1716
1716 blk_put_request(srp->rq); 1717 blk_put_request(srp->rq);
1717 } 1718 }
1718 1719
1719 sg_remove_request(sfp, srp); 1720 sg_remove_request(sfp, srp);
1721
1722 return ret;
1720} 1723}
1721 1724
1722static int 1725static int