From: Julia Lawall <Julia.Lawall@lip6.fr>
To: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: kernel-janitors@vger.kernel.org,
Aloisio Almeida Jr <aloisio.almeida@openbossa.org>,
Samuel Ortiz <sameo@linux.intel.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/6] NFC: pn533: fix error return code
Date: Sat, 22 Nov 2014 15:39:14 +0100 [thread overview]
Message-ID: <1416667159-9808-2-git-send-email-Julia.Lawall@lip6.fr> (raw)
In-Reply-To: <1416667159-9808-1-git-send-email-Julia.Lawall@lip6.fr>
From: Julia Lawall <Julia.Lawall@lip6.fr>
Return a negative error code on failure.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
The error code is chosen according to the other call to this function
in the same file.
drivers/nfc/pn533.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index d46a700..a859303 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -2554,8 +2554,10 @@ static int pn533_data_exchange_complete(struct pn533 *dev, void *_arg,
}
skb = pn533_build_response(dev);
- if (!skb)
+ if (!skb) {
+ rc = -EIO;
goto error;
+ }
arg->cb(arg->cb_context, skb, 0);
kfree(arg);
next prev parent reply other threads:[~2014-11-22 14:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-22 14:39 [PATCH 0/6] " Julia Lawall
2014-11-22 14:39 ` Julia Lawall [this message]
2014-11-22 14:39 ` [PATCH 2/6] i7core_edac: " Julia Lawall
2014-11-22 14:39 ` [PATCH 3/6] HSI: nokia-modem: " Julia Lawall
2014-11-22 14:39 ` [PATCH 4/6] solos-pci: " Julia Lawall
2014-11-23 19:30 ` David Miller
2014-11-22 14:39 ` [PATCH 5/6] ib_srpt: " Julia Lawall
2014-11-24 11:36 ` Bart Van Assche
2014-11-22 14:39 ` [PATCH 6/6] dmaengine: ste_dma40: " Julia Lawall
2014-11-28 11:57 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1416667159-9808-2-git-send-email-Julia.Lawall@lip6.fr \
--to=julia.lawall@lip6.fr \
--cc=aloisio.almeida@openbossa.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=lauro.venancio@openbossa.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®