USB: mos7720: use GFP_ATOMIC under spinlock
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 16 Aug 2013 07:16:59 +0000 (10:16 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Sep 2013 00:18:06 +0000 (17:18 -0700)
commit d0bd9a41186e076ea543c397ad8a67a6cf604b55 upstream.

The write_parport_reg_nonblock() function shouldn't sleep because it's
called with spinlocks held.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/mos7720.c

index 5050cc8584babfc38d4ce0132f94d8fd0d1de171..6577b7d1d2b80f626ab790b548f5ed37f4b01278 100644 (file)
@@ -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);