NFC: pn533: don't send USB data off of the stack
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 May 2018 13:19:46 +0000 (15:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 May 2018 10:43:14 +0000 (12:43 +0200)
commitdbafc28955fa6779dc23d1607a0fee5e509a278b
tree45ec293f30673ea7da73317d98cdea428f1b04dc
parent7eeb11190f44bb1a5d1098b6ae0451690359dff2
NFC: pn533: don't send USB data off of the stack

It's amazing that this driver ever worked, but now that x86 doesn't
allow USB data to be sent off of the stack, it really does not work at
all.  Fix this up by properly allocating the data for the small
"commands" that get sent to the device off of the stack.

We do this for one command by having a whole urb just for ack messages,
as they can be submitted in interrupt context, so we can not use
usb_bulk_msg().  But the poweron command can sleep (and does), so use
usb_bulk_msg() for that transfer.

Reported-by: Carlos Manuel Santos <cmmpsantos@gmail.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nfc/pn533/usb.c