diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2014-02-06 20:28:31 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-02-23 23:14:45 +0100 |
commit | 44a589ca2de4d7980f8b335481a09bf818065dbe (patch) | |
tree | fb077d602164143d84650b5f72e2b83b181b2baf /net/nfc | |
parent | ath9k: Fix ETSI compliance for AR9462 2.0 (diff) | |
download | linux-44a589ca2de4d7980f8b335481a09bf818065dbe.tar.xz 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/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) { |