[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1269415120.19347.1.camel@wall-e.seibold.net>
Date: Wed, 24 Mar 2010 08:18:40 +0100
From: Stefani Seibold <stefani@...bold.net>
To: David Härdeman <david@...deman.nu>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fix INIT_KFIFO in include/linux/kfifo.h - part 2
DECLARE_KFIFO creates a union with a struct kfifo and a buffer array with
size [size + sizeof(struct kfifo)].
INIT_KFIFO then sets the buffer pointer in struct kfifo to point to the
beginning of the buffer array which means that the first call to kfifo_in
will overwrite members of the struct kfifo.
This patch was the least invasive fix I could come up with...
Signed-off-by: David Härdeman <david@...deman.nu>
Acked-by: stefani@...bold.net
CC: stable@...nel.org
---
include/linux/kfifo.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index ece0b1c..e117b1a 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -86,7 +86,8 @@ union { \
*/
#define INIT_KFIFO(name) \
name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \
- sizeof(struct kfifo), name##kfifo_buffer)
+ sizeof(struct kfifo), \
+ name##kfifo_buffer + sizeof(struct kfifo))
/**
* DEFINE_KFIFO - macro to define and initialize a kfifo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists