[PATCH 10/11] NFC: pn533: set cmd status when not set

From: Michael Thalmeier
Date: Thu Apr 21 2016 - 10:44:59 EST


When pn533_recv_frame is called with skb = NULL and cmd->status = 0, set
cmd->status to an error code.

Signed-off-by: Michael Thalmeier <michael.thalmeier@xxxxxxx>
---
drivers/nfc/pn533/pn533.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c
index ae13277..44bc5e0 100644
--- a/drivers/nfc/pn533/pn533.c
+++ b/drivers/nfc/pn533/pn533.c
@@ -2040,6 +2040,8 @@ void pn533_recv_frame(struct pn533 *dev, struct sk_buff *skb, int status)

if (skb == NULL) {
pr_err("NULL Frame -> link is dead\n");
+ if (!dev->cmd->status)
+ dev->cmd->status = -ENOENT;
goto sched_wq;
}

--
2.5.5