Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3dfcb701 authored by Tony Battersby's avatar Tony Battersby Committed by James Bottomley
Browse files

[SCSI] sym53c8xx: fix resid calculation



This patch fixes the calculation of the data transfer residual for the
case of a command that is supposed to transfer an odd number of bytes on
a wide bus but transfers nothing instead.

Signed-off-by: default avatarTony Battersby <tonyb@cybernetics.com>
Cc: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 51883b5e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3842,7 +3842,7 @@ int sym_compute_residual(struct sym_hcb *np, struct sym_ccb *cp)
	if (cp->startp == cp->phys.head.lastp ||
	if (cp->startp == cp->phys.head.lastp ||
	    sym_evaluate_dp(np, cp, scr_to_cpu(cp->phys.head.lastp),
	    sym_evaluate_dp(np, cp, scr_to_cpu(cp->phys.head.lastp),
			    &dp_ofs) < 0) {
			    &dp_ofs) < 0) {
		return cp->data_len;
		return cp->data_len - cp->odd_byte_adjustment;
	}
	}


	/*
	/*