Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: pn533: Fix wrong GFP flag usage

pn533_recv_response() is an urb completion handler, so it must use
GFP_ATOMIC. pn533_usb_send_frame() OTOH runs from a regular sleeping
context, so the pn533_submit_urb_for_response() there (and only there)
can use the regular GFP_KERNEL flags.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514134
Fixes: 9815c7cf22da ("NFC: pn533: Separate physical layer from ...")
Cc: Michael Thalmeier <michael.thalmeier@hale.at>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Hans de Goede and committed by
Greg Kroah-Hartman
ecc443c0 4a762569

+2 -2
+2 -2
drivers/nfc/pn533/usb.c
··· 74 74 struct sk_buff *skb = NULL; 75 75 76 76 if (!urb->status) { 77 - skb = alloc_skb(urb->actual_length, GFP_KERNEL); 77 + skb = alloc_skb(urb->actual_length, GFP_ATOMIC); 78 78 if (!skb) { 79 79 nfc_err(&phy->udev->dev, "failed to alloc memory\n"); 80 80 } else { ··· 186 186 187 187 if (dev->protocol_type == PN533_PROTO_REQ_RESP) { 188 188 /* request for response for sent packet directly */ 189 - rc = pn533_submit_urb_for_response(phy, GFP_ATOMIC); 189 + rc = pn533_submit_urb_for_response(phy, GFP_KERNEL); 190 190 if (rc) 191 191 goto error; 192 192 } else if (dev->protocol_type == PN533_PROTO_REQ_ACK_RESP) {