Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44a589ca authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by Samuel Ortiz
Browse files

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: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent b3050248
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {