Skip to content

Commit

Permalink
NFC: NCI: Fix NULL pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amitkumar Karwar authored and Samuel Ortiz committed Feb 23, 2014
1 parent b305024 commit 44a589c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/nfc/nci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 44a589c

Please sign in to comment.