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>
This commit is contained in:
Amitkumar Karwar 2014-02-06 11:28:31 -08:00 committed by Samuel Ortiz
parent b3050248c1
commit 44a589ca2d
1 changed files with 1 additions and 1 deletions

View File

@ -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) {