summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2014-02-06 11:28:31 -0800
committerSamuel Ortiz <sameo@linux.intel.com>2014-02-23 23:14:45 +0100
commit44a589ca2de4d7980f8b335481a09bf818065dbe (patch)
treefb077d602164143d84650b5f72e2b83b181b2baf /net
parentb3050248c167871ca52cfdb2ce78aa2460249346 (diff)
downloadlinux-44a589ca2de4d7980f8b335481a09bf818065dbe.tar.gz
linux-44a589ca2de4d7980f8b335481a09bf818065dbe.tar.bz2
linux-44a589ca2de4d7980f8b335481a09bf818065dbe.zip
NFC: NCI: Fix NULL pointer dereference
The check should be for setup function pointer. This patch fixes NULL pointer dereference issue for NCI based NFC driver which doesn't define setup handler. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/nfc/nci/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 46bda010bf11..56db888b1cd5 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -301,7 +301,7 @@ static int nci_open_device(struct nci_dev *ndev)
rc = __nci_request(ndev, nci_reset_req, 0,
msecs_to_jiffies(NCI_RESET_TIMEOUT));
- if (ndev->ops->setup(ndev))
+ if (ndev->ops->setup)
ndev->ops->setup(ndev);
if (!rc) {