Commit b6355fb3 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Samuel Ortiz

nfc: fdp: fix NULL pointer dereference

We are checking phy after dereferencing it. We can print the debug
information after checking it. If phy is NULL then we will get a good
stack trace to tell us that we are in this irq handler.
Signed-off-by: default avatarSudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent ce69b95c
...@@ -210,14 +210,14 @@ static irqreturn_t fdp_nci_i2c_irq_thread_fn(int irq, void *phy_id) ...@@ -210,14 +210,14 @@ static irqreturn_t fdp_nci_i2c_irq_thread_fn(int irq, void *phy_id)
struct sk_buff *skb; struct sk_buff *skb;
int r; int r;
client = phy->i2c_dev;
dev_dbg(&client->dev, "%s\n", __func__);
if (!phy || irq != phy->i2c_dev->irq) { if (!phy || irq != phy->i2c_dev->irq) {
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
return IRQ_NONE; return IRQ_NONE;
} }
client = phy->i2c_dev;
dev_dbg(&client->dev, "%s\n", __func__);
r = fdp_nci_i2c_read(phy, &skb); r = fdp_nci_i2c_read(phy, &skb);
if (r == -EREMOTEIO) if (r == -EREMOTEIO)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment