Skip to content
Commit 03116d67 authored by Mikael Pettersson's avatar Mikael Pettersson Committed by Jeff Garzik
Browse files

sata_promise: fix endianess bug in ASIC PRD bug workaround



The original workaround for the Promise ASIC PRD bug
contained an endianess bug which I failed to detect:
the adjustment of the last PRD entry's length field
applied host arithmetic to little-endian data, which
is incorrect on big-endian machines.

We have the length available in host-endian format, so
do the adjustment on host-endian data and then convert
and store it in the PRD entry's little-endian data field.

Thanks to an anonymous reviewer for detecting this bug.

Signed-off-by: default avatarMikael Pettersson <mikpe@it.uu.se>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 48166fd9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment