]> git.baikalelectronics.ru Git - kernel.git/commit
NFC: pn533: fix bulk-message timeout
authorJohan Hovold <johan@kernel.org>
Mon, 13 Jan 2020 17:23:58 +0000 (18:23 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 14 Jan 2020 02:50:18 +0000 (18:50 -0800)
commitbd6c8ed07b1b6984e649d435f130b384b2b3fa6e
tree9fbf7e1efb2a2a873c30efe26e760d43260242bd
parent8404b666256d94f7415fb6f2b9dde8f95e2dc3df
NFC: pn533: fix bulk-message timeout

The driver was doing a synchronous uninterruptible bulk-transfer without
using a timeout. This could lead to the driver hanging on probe due to a
malfunctioning (or malicious) device until the device is physically
disconnected. While sleeping in probe the driver prevents other devices
connected to the same hub from being added to (or removed from) the bus.

An arbitrary limit of five seconds should be more than enough.

Fixes: d76d5e793f87 ("NFC: pn533: don't send USB data off of the stack")
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/nfc/pn533/usb.c