From: Dan Carpenter <dan.carpenter@oracle.com>
To: yash.shah@sifive.com
Cc: linux-edac@vger.kernel.org
Subject: [bug report] EDAC/sifive: Add EDAC platform driver for SiFive SoCs
Date: Wed, 14 Aug 2019 17:31:36 +0300 [thread overview]
Message-ID: <20190814143136.GA3226@mwanda> (raw)
Hello Yash Shah,
The patch 91abaeaaff35: "EDAC/sifive: Add EDAC platform driver for
SiFive SoCs" from May 6, 2019, leads to the following static checker
warning:
drivers/edac/sifive_edac.c:60 ecc_register()
warn: 'p->dci' can also be NULL
drivers/edac/sifive_edac.c
43 static int ecc_register(struct platform_device *pdev)
44 {
45 struct sifive_edac_priv *p;
46
47 p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
48 if (!p)
49 return -ENOMEM;
50
51 p->notifier.notifier_call = ecc_err_event;
52 platform_set_drvdata(pdev, p);
53
54 p->dci = edac_device_alloc_ctl_info(0, "sifive_ecc", 1, "sifive_ecc",
55 1, 1, NULL, 0,
56 edac_device_alloc_index());
57 if (IS_ERR(p->dci))
^^^^^^^^^^^^^^
The edac_device_alloc_ctl_info() function never returns error pointers,
it returns NULL.
58 return PTR_ERR(p->dci);
59
60 p->dci->dev = &pdev->dev;
61 p->dci->mod_name = "Sifive ECC Manager";
62 p->dci->ctl_name = dev_name(&pdev->dev);
63 p->dci->dev_name = dev_name(&pdev->dev);
64
regards,
dan carpenter
next reply other threads:[~2019-08-14 14:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-14 14:31 Dan Carpenter [this message]
2019-08-20 6:11 ` [bug report] EDAC/sifive: Add EDAC platform driver for SiFive SoCs Yash Shah
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=20190814143136.GA3226@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-edac@vger.kernel.org \
--cc=yash.shah@sifive.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).