提交 44a589ca 编写于 作者: A Amitkumar Karwar 提交者: Samuel Ortiz

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: NAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: NBing Zhao <bzhao@marvell.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 b3050248
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册