From: Rusty Russell Date: Fri, 11 Jan 2008 09:12:55 +0000 (+0100) Subject: Don't blatt first element of prv in sg_chain() X-Git-Tag: v2.6.24-rc8~46^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b801a1e7dbca3f51d0a4b22a750ae257196002cb;p=karo-tx-linux.git Don't blatt first element of prv in sg_chain() I realize that sg chaining is a ploy to make the rest of the kernel devs feel the pain of the SCSI subsystem. But this was a little unsubtle. Signed-off-by: Rusty Russell Acked-by: Tejun Heo Signed-off-by: Jens Axboe --- diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 416e000dfe81..e3ff21dbac53 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -191,8 +191,8 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, /* * offset and length are unused for chain entry. Clear them. */ - prv->offset = 0; - prv->length = 0; + prv[prv_nents - 1].offset = 0; + prv[prv_nents - 1].length = 0; /* * Set lowest bit to indicate a link pointer, and make sure to clear