]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
NFC: nfcmrvl: fix gpio-handling regression
authorJohan Hovold <johan@kernel.org>
Mon, 5 Aug 2019 10:00:55 +0000 (12:00 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 4 Sep 2019 06:16:38 +0000 (02:16 -0400)
commitf889b76b089737d29feb4bb429e7cb664e9301c7
tree7819543fa8605881a0d6c817ee6890ad55152ab4
parent70e32167b3bc85698dd224b437956912e9f111e6
NFC: nfcmrvl: fix gpio-handling regression

BugLink: https://bugs.launchpad.net/bugs/1840378
[ Upstream commit c3953a3c2d3175d2f9f0304c9a1ba89e7743c5e4 ]

Fix two reset-gpio sanity checks which were never converted to use
gpio_is_valid(), and make sure to use -EINVAL to indicate a missing
reset line also for the UART-driver module parameter and for the USB
driver.

This specifically prevents the UART and USB drivers from incidentally
trying to request and use gpio 0, and also avoids triggering a WARN() in
gpio_to_desc() during probe when no valid reset line has been specified.

Fixes: e33a3f84f88f ("NFC: nfcmrvl: allow gpio 0 for reset signalling")
Reported-by: syzbot+cf35b76f35e068a1107f@syzkaller.appspotmail.com
Tested-by: syzbot+cf35b76f35e068a1107f@syzkaller.appspotmail.com
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/nfc/nfcmrvl/main.c
drivers/nfc/nfcmrvl/uart.c
drivers/nfc/nfcmrvl/usb.c