diff options
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index bfa86b378fb9..b098942445ec 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1799,8 +1799,10 @@ sg_build_direct(Sg_request * srp, Sg_fd * sfp, int dxfer_len) | |||
1799 | res = st_map_user_pages(schp->buffer, mx_sc_elems, | 1799 | res = st_map_user_pages(schp->buffer, mx_sc_elems, |
1800 | (unsigned long)hp->dxferp, dxfer_len, | 1800 | (unsigned long)hp->dxferp, dxfer_len, |
1801 | (SG_DXFER_TO_DEV == hp->dxfer_direction) ? 1 : 0); | 1801 | (SG_DXFER_TO_DEV == hp->dxfer_direction) ? 1 : 0); |
1802 | if (res <= 0) | 1802 | if (res <= 0) { |
1803 | sg_remove_scat(schp); | ||
1803 | return 1; | 1804 | return 1; |
1805 | } | ||
1804 | schp->k_use_sg = res; | 1806 | schp->k_use_sg = res; |
1805 | schp->dio_in_use = 1; | 1807 | schp->dio_in_use = 1; |
1806 | hp->info |= SG_INFO_DIRECT_IO; | 1808 | hp->info |= SG_INFO_DIRECT_IO; |