diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2014-02-06 11:28:31 -0800 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-02-23 23:14:45 +0100 |
commit | 44a589ca2de4d7980f8b335481a09bf818065dbe (patch) | |
tree | fb077d602164143d84650b5f72e2b83b181b2baf /net/nfc | |
parent | b3050248c167871ca52cfdb2ce78aa2460249346 (diff) | |
download | linux-44a589ca2de4d7980f8b335481a09bf818065dbe.tar.bz2 |
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/nfc')
-rw-r--r-- | net/nfc/nci/core.c | 2 |
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) { |