USB: mos7720: use GFP_ATOMIC under spinlock
Subsystems (3)
PATCH 1/1 USB: mos7720: use GFP_ATOMIC under spinlock
The write_parport_reg_nonblock() function shouldn't sleep because it's called with spinlocks held.
---
drivers/usb/serial/mos7720.c +1 -1
@@ -374,7 +374,7 @@ static int write_parport_reg_nonblock(struct mos7715_parport *mos_parport,kfree (urbtrack);return -ENOMEM ; } - urbtrack->setup =kmalloc (sizeof (*urbtrack->setup),GFP_KERNEL ); + urbtrack->setup =kmalloc (sizeof (*urbtrack->setup),GFP_ATOMIC );if (!urbtrack->setup) {usb_free_urb (urbtrack->urb);kfree (urbtrack);
Quoted 2 lines · Dan Carpenter
The
write_parport_reg_nonblock()function shouldn't sleep because it's called with spinlocks held.
Ouch. Thanks for catching this.
Quoted 1 line
Signed-off-by Dan Carpenter <[email protected]>
Greg, this one is needed in 3.11 (with a stable tag) as the offending commit ef6c8c1d ("USB: mos7720: fix broken control requests") is in usb-3.11-rc6.
Thanks,
Johan
Quoted 15 lines
---
drivers/usb/serial/mos7720.c +1
-1@@ -374,7 +374,7 @@ static int write_parport_reg_nonblock(struct mos7715_parport *mos_parport,kfree (urbtrack);return -ENOMEM ; } - urbtrack->setup =kmalloc (sizeof (*urbtrack->setup),GFP_KERNEL ); + urbtrack->setup =kmalloc (sizeof (*urbtrack->setup),GFP_ATOMIC );if (!urbtrack->setup) {usb_free_urb (urbtrack->urb);kfree (urbtrack);
Greg Kroah-Hartman
maintainerQuoted 6 lines · Johan Hovold
Quoted 2 lines · Dan Carpenter
The
write_parport_reg_nonblock()function shouldn't sleep because it's called with spinlocks held.Ouch. Thanks for catching this.
Quoted 8 lines
Quoted 1 line
Signed-off-by Dan Carpenter <[email protected]>Greg, this one is needed in 3.11 (with a stable tag) as the offending commit
ef6c8c1d("USB: mos7720: fix broken control requests") is in usb-3.11-rc6.
Ok, I'll mark it as such, thanks.
greg k-h