Linux-EDAC Archive on lore.kernel.org
 help / color / Atom feed
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
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

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically 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

Linux-EDAC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-edac/0 linux-edac/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-edac linux-edac/ https://lore.kernel.org/linux-edac \
		linux-edac@vger.kernel.org linux-edac@archiver.kernel.org
	public-inbox-index linux-edac


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-edac


AGPL code for this site: git clone https://public-inbox.org/ public-inbox