Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ecc443c0 authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman
Browse files

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: 9815c7cf ("NFC: pn533: Separate physical layer from ...")
Cc: Michael Thalmeier <michael.thalmeier@hale.at>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a762569
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -74,7 +74,7 @@ static void pn533_recv_response(struct urb *urb)
	struct sk_buff *skb = NULL;
	struct sk_buff *skb = NULL;


	if (!urb->status) {
	if (!urb->status) {
		skb = alloc_skb(urb->actual_length, GFP_KERNEL);
		skb = alloc_skb(urb->actual_length, GFP_ATOMIC);
		if (!skb) {
		if (!skb) {
			nfc_err(&phy->udev->dev, "failed to alloc memory\n");
			nfc_err(&phy->udev->dev, "failed to alloc memory\n");
		} else {
		} else {
@@ -186,7 +186,7 @@ static int pn533_usb_send_frame(struct pn533 *dev,


	if (dev->protocol_type == PN533_PROTO_REQ_RESP) {
	if (dev->protocol_type == PN533_PROTO_REQ_RESP) {
		/* request for response for sent packet directly */
		/* request for response for sent packet directly */
		rc = pn533_submit_urb_for_response(phy, GFP_ATOMIC);
		rc = pn533_submit_urb_for_response(phy, GFP_KERNEL);
		if (rc)
		if (rc)
			goto error;
			goto error;
	} else if (dev->protocol_type == PN533_PROTO_REQ_ACK_RESP) {
	} else if (dev->protocol_type == PN533_PROTO_REQ_ACK_RESP) {