aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorUlrich Kunitz <kune@deine-taler.de>2006-11-21 19:06:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-11-28 14:10:48 -0500
commita68077defb3337342981a0d3a4df3380496a8a87 (patch)
tree334fc72579b624314ced6058efc59707e39bb375 /drivers
parenta3df3b6f2e37474cdb8b56d55d31be41c22f9b18 (diff)
[PATCH] zd1211rw: Fix of a locking bug
This patch fixes the bug as reported in the kernel bug tracker under the id 7244. The bug was simply that the interrupt lock has been locked outside an interrupt without blocking the interrupt. Signed-off-by: Ulrich Kunitz <kune@deine-taler.de> Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index 3faaeb2b7c89..a15b09549245 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -366,15 +366,6 @@ error:
366 return r; 366 return r;
367} 367}
368 368
369static void disable_read_regs_int(struct zd_usb *usb)
370{
371 struct zd_usb_interrupt *intr = &usb->intr;
372
373 spin_lock(&intr->lock);
374 intr->read_regs_enabled = 0;
375 spin_unlock(&intr->lock);
376}
377
378#define urb_dev(urb) (&(urb)->dev->dev) 369#define urb_dev(urb) (&(urb)->dev->dev)
379 370
380static inline void handle_regs_int(struct urb *urb) 371static inline void handle_regs_int(struct urb *urb)
@@ -1156,10 +1147,19 @@ static void prepare_read_regs_int(struct zd_usb *usb)
1156{ 1147{
1157 struct zd_usb_interrupt *intr = &usb->intr; 1148 struct zd_usb_interrupt *intr = &usb->intr;
1158 1149
1159 spin_lock(&intr->lock); 1150 spin_lock_irq(&intr->lock);
1160 intr->read_regs_enabled = 1; 1151 intr->read_regs_enabled = 1;
1161 INIT_COMPLETION(intr->read_regs.completion); 1152 INIT_COMPLETION(intr->read_regs.completion);
1162 spin_unlock(&intr->lock); 1153 spin_unlock_irq(&intr->lock);
1154}
1155
1156static void disable_read_regs_int(struct zd_usb *usb)
1157{
1158 struct zd_usb_interrupt *intr = &usb->intr;
1159
1160 spin_lock_irq(&intr->lock);
1161 intr->read_regs_enabled = 0;
1162 spin_unlock_irq(&intr->lock);
1163} 1163}
1164 1164
1165static int get_results(struct zd_usb *usb, u16 *values, 1165static int get_results(struct zd_usb *usb, u16 *values,
@@ -1171,7 +1171,7 @@ static int get_results(struct zd_usb *usb, u16 *values,
1171 struct read_regs_int *rr = &intr->read_regs; 1171 struct read_regs_int *rr = &intr->read_regs;
1172 struct usb_int_regs *regs = (struct usb_int_regs *)rr->buffer; 1172 struct usb_int_regs *regs = (struct usb_int_regs *)rr->buffer;
1173 1173
1174 spin_lock(&intr->lock); 1174 spin_lock_irq(&intr->lock);
1175 1175
1176 r = -EIO; 1176 r = -EIO;
1177 /* The created block size seems to be larger than expected. 1177 /* The created block size seems to be larger than expected.
@@ -1204,7 +1204,7 @@ static int get_results(struct zd_usb *usb, u16 *values,
1204 1204
1205 r = 0; 1205 r = 0;
1206error_unlock: 1206error_unlock:
1207 spin_unlock(&intr->lock); 1207 spin_unlock_irq(&intr->lock);
1208 return r; 1208 return r;
1209} 1209}
1210 1210