alistair23-linux/drivers/nfc
Johan Hovold 0cbe40112f NFC: nfcmrvl: do not use device-managed resources
This specifically fixes resource leaks in the registration error paths.

Device-managed resources is a bad fit for this driver as devices can be
registered from the n_nci line discipline. Firstly, a tty may not even
have a corresponding device (should it be part of a Unix98 pty)
something which would lead to a NULL-pointer dereference when
registering resources.

Secondly, if the tty has a class device, its lifetime exceeds that of
the line discipline, which means that resources would leak every time
the line discipline is closed (or if registration fails).

Currently, the devres interface was only being used to request a reset
gpio despite the fact that it was already explicitly freed in
nfcmrvl_nci_unregister_dev() (along with the private data), something
which also prevented the resource leak at close.

Note that the driver treats gpio number 0 as invalid despite it being
perfectly valid. This will be addressed in a follow-up patch.

Fixes: b2fe288eac ("NFC: nfcmrvl: free reset gpio")
Fixes: 4a2b947f56 ("NFC: nfcmrvl: add chip reset management")
Cc: stable <stable@vger.kernel.org>     # 4.2: b2fe288eac
Cc: Vincent Cuissard <cuissard@marvell.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2017-06-18 23:57:59 +02:00
..
fdp networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
microread networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
nfcmrvl NFC: nfcmrvl: do not use device-managed resources 2017-06-18 23:57:59 +02:00
nxp-nci networking: make skb_pull & friends return void pointers 2017-06-16 11:48:39 -04:00
pn533 networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
pn544 networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
s3fwrn5 networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
st-nci networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00
st21nfca networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
st95hf networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
Kconfig NFC: trf7970a: Convert to descriptor based GPIO interface 2017-06-18 23:57:58 +02:00
Makefile NFC: remove TI nfcwilink driver 2017-04-01 23:04:30 +02:00
mei_phy.c mei: bus: split RX and async notification callbacks 2016-11-17 16:37:49 +01:00
mei_phy.h
nfcsim.c NFC: nfcsim: Simulate lost frames through debugfs entry 2016-07-19 23:24:49 +02:00
port100.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
trf7970a.c NFC: trf7970a: Clean up coding style issues 2017-06-18 23:57:58 +02:00