linux/net/nfc
Johan Hovold b4e587fa52 NFC: fix device-allocation error return
commit c45e3e4c5b upstream.

A recent change fixing NFC device allocation itself introduced an
error-handling bug by returning an error pointer in case device-id
allocation failed. This is clearly broken as the callers still expected
NULL to be returned on errors as detected by Dan's static checker.

Fix this up by returning NULL in the event that we've run out of memory
when allocating a new device id.

Note that the offending commit is marked for stable (3.8) so this fix
needs to be backported along with it.

Fixes: 20777bc57c ("NFC: fix broken device allocation")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-02-13 18:42:15 +00:00
..
hci NFC: hci: Fix sparse: cast to restricted __be16 2014-04-22 00:37:29 +02:00
nci NFC: NCI: Send all NCI frames to raw sockets 2014-05-20 00:23:59 +02:00
af_nfc.c nfc: Fix FSF address in file headers 2013-12-11 10:56:21 -05:00
core.c NFC: fix device-allocation error return 2018-02-13 18:42:15 +00:00
digital.h NFC: digital: Add support for ISO/IEC 14443-B Protocol 2014-04-22 00:37:28 +02:00
digital_core.c NFC: digital: Randomize poll cycles 2014-05-26 00:42:02 +02:00
digital_dep.c NFC: digital: Return proper error code when sending ATR_REQ 2014-05-26 00:42:02 +02:00
digital_technology.c NFC: digital: digital_in_send_attrib_req() can be static 2014-05-26 00:52:15 +02:00
Kconfig NFC Digital: Add NFC-F technology support 2013-09-25 02:02:25 +02:00
llcp.h nfc: Fix FSF address in file headers 2013-12-11 10:56:21 -05:00
llcp_commands.c NFC: Add RAW socket type support for SOCKPROTO_RAW 2014-05-20 00:06:04 +02:00
llcp_core.c net: add __pskb_copy_fclone and pskb_copy_for_clone 2014-06-11 15:38:02 -07:00
llcp_sock.c net: add build-time checks for msg->msg_name size 2014-01-18 23:04:16 -08:00
Makefile NFC Digital: Add initiator NFC-DEP support 2013-09-25 02:02:27 +02:00
netlink.c NFC: Add netlink support for ISO/IEC 15693 2014-02-16 23:49:53 +01:00
nfc.h NFC: Add RAW socket type support for SOCKPROTO_RAW 2014-05-20 00:06:04 +02:00
rawsock.c net: add __pskb_copy_fclone and pskb_copy_for_clone 2014-06-11 15:38:02 -07:00