]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] packet writing oops fix
authorPeter Osterlund <petero2@telia.com>
Mon, 14 Nov 2005 00:06:36 +0000 (16:06 -0800)
committerChris Wright <chrisw@osdl.org>
Thu, 24 Nov 2005 22:10:07 +0000 (14:10 -0800)
There is an old bug in the pkt_count_states() function that causes stack
corruption.  When compiling with gcc 3.x or 2.x it is harmless, but gcc 4
allocates local variables differently, which makes the bug visible.

Signed-off-by: Peter Osterlund <petero2@telia.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/block/pktcdvd.c

index a280e679b1cad14b256db0b7b5d747bd2b76662d..a10ee0266e829f2e83b2af91a5c55f7ce7c7d537 100644 (file)
@@ -1191,7 +1191,7 @@ static void pkt_count_states(struct pktcdvd_device *pd, int *states)
        struct packet_data *pkt;
        int i;
 
-       for (i = 0; i <= PACKET_NUM_STATES; i++)
+       for (i = 0; i < PACKET_NUM_STATES; i++)
                states[i] = 0;
 
        spin_lock(&pd->cdrw.active_list_lock);