Skip to content

Commit a3af901

Browse files
hygoniJiri Kosina
authored andcommitted
HID: usbkbd: Avoid GFP_ATOMIC when GFP_KERNEL is possible
usb_kbd_alloc_mem is called in usb_kbd_probe, which is not in atomic context. So constraints can be relaxed here. Use GFP_KERNEL instead of GFP_ATOMIC. Signed-off-by: Hyeonggon Yoo <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 04c22ee commit a3af901

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/usbhid/usbkbd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd)
239239
return -1;
240240
if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL)))
241241
return -1;
242-
if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma)))
242+
if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbd->new_dma)))
243243
return -1;
244244
if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL)))
245245
return -1;
246-
if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, &kbd->leds_dma)))
246+
if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_KERNEL, &kbd->leds_dma)))
247247
return -1;
248248

249249
return 0;

0 commit comments

Comments
 (0)