From: Dan Carpenter <dan.carpenter@oracle.com>
To: thierry.escande@collabora.com
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] NFC: nfcsim: Make use of the Digital layer
Date: Wed, 3 Aug 2016 14:40:23 +0300 [thread overview]
Message-ID: <20160803114023.GA23064@mwanda> (raw)
Hello Thierry Escande,
The patch 204bddcb508f: "NFC: nfcsim: Make use of the Digital layer"
from Jun 23, 2016, leads to the following static checker warning:
drivers/nfc/nfcsim.c:485 nfcsim_init()
error: we previously assumed 'link0' could be null (see line 457)
drivers/nfc/nfcsim.c
450 static int __init nfcsim_init(void)
451 {
452 struct nfcsim_link *link0, *link1;
453 int rc;
454
455 link0 = nfcsim_link_new();
456 link1 = nfcsim_link_new();
457 if (!link0 || !link1) {
Say link0 is NULL here.
458 rc = -ENOMEM;
459 goto exit_err;
460 }
461
462 nfcsim_debugfs_init();
463
464 dev0 = nfcsim_device_new(link0, link1);
465 if (IS_ERR(dev0)) {
466 rc = PTR_ERR(dev0);
467 goto exit_err;
468 }
469
470 dev1 = nfcsim_device_new(link1, link0);
471 if (IS_ERR(dev1)) {
472 nfcsim_device_free(dev0);
473
474 rc = PTR_ERR(dev1);
475 goto exit_err;
476 }
477
478 pr_info("nfcsim " NFCSIM_VERSION " initialized\n");
479
480 return 0;
481
482 exit_err:
483 pr_err("Failed to initialize nfcsim driver (%d)\n", rc);
484
485 nfcsim_link_free(link0);
We oops inside the call to nfcsim_link_free().
486 nfcsim_link_free(link1);
487
488 return rc;
489 }
regards,
dan carpenter
reply other threads:[~2016-08-03 11:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20160803114023.GA23064@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-wireless@vger.kernel.org \
--cc=thierry.escande@collabora.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;
as well as URLs for NNTP newsgroup(s).