mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
sg: fix read() error reporting
Fix SCSI generic read() incorrectly returning success after detecting an error. Cc: <[email protected]> Signed-off-by: Tony Battersby <[email protected]> Acked-by: Douglas Gilbert <[email protected]> Signed-off-by: James Bottomley <[email protected]>
This commit is contained in:
parent
2ecf8e0ae2
commit
3b524a683a
1 changed files with 3 additions and 3 deletions
|
|
@ -546,7 +546,7 @@ static ssize_t
|
|||
sg_new_read(Sg_fd * sfp, char __user *buf, size_t count, Sg_request * srp)
|
||||
{
|
||||
sg_io_hdr_t *hp = &srp->header;
|
||||
int err = 0;
|
||||
int err = 0, err2;
|
||||
int len;
|
||||
|
||||
if (count < SZ_SG_IO_HDR) {
|
||||
|
|
@ -575,8 +575,8 @@ sg_new_read(Sg_fd * sfp, char __user *buf, size_t count, Sg_request * srp)
|
|||
goto err_out;
|
||||
}
|
||||
err_out:
|
||||
err = sg_finish_rem_req(srp);
|
||||
return (0 == err) ? count : err;
|
||||
err2 = sg_finish_rem_req(srp);
|
||||
return err ? : err2 ? : count;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
|
|
|||
Loading…
Reference in a new issue