Commit ae7642bb authored by Peter Osterlund's avatar Peter Osterlund Committed by Linus Torvalds

[PATCH] packet writing oops fix

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: default avatarPeter Osterlund <petero2@telia.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5563e770
...@@ -1188,7 +1188,7 @@ static void pkt_count_states(struct pktcdvd_device *pd, int *states) ...@@ -1188,7 +1188,7 @@ static void pkt_count_states(struct pktcdvd_device *pd, int *states)
struct packet_data *pkt; struct packet_data *pkt;
int i; int i;
for (i = 0; i <= PACKET_NUM_STATES; i++) for (i = 0; i < PACKET_NUM_STATES; i++)
states[i] = 0; states[i] = 0;
spin_lock(&pd->cdrw.active_list_lock); spin_lock(&pd->cdrw.active_list_lock);
......
Markdown is supported
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