linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhen Lei <thunder.leizhen@huawei.com>
To: Johannes Thumshirn <morbidrsa@gmail.com>,
	Borislav Petkov <bp@alien8.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Tony Luck <tony.luck@intel.com>,
	James Morse <james.morse@arm.com>,
	Robert Richter <rric@kernel.org>,
	"Doug Thompson" <dougthompson@xmission.com>,
	Dave Jiang <djiang@mvista.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-edac <linux-edac@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Cc: Zhen Lei <thunder.leizhen@huawei.com>
Subject: [PATCH 1/1] EDAC, mpc85xx: Fix error return code in two functions
Date: Fri, 28 May 2021 11:26:37 +0800	[thread overview]
Message-ID: <20210528032637.9231-1-thunder.leizhen@huawei.com> (raw)

Fix to return -EFAULT from the error handling case instead of 0, as done
elsewhere in its function.

Fixes: a9a753d53204 ("drivers-edac: add freescale mpc85xx driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/edac/mpc85xx_edac.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 67f7bc3fe5b3..b2eaa62c9412 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -248,6 +248,7 @@ static int mpc85xx_pci_err_probe(struct platform_device *op)
 
 	if (edac_pci_add_device(pci, pdata->edac_idx) > 0) {
 		edac_dbg(3, "failed edac_pci_add_device()\n");
+		res = -EFAULT;
 		goto err;
 	}
 
@@ -552,6 +553,7 @@ static int mpc85xx_l2_err_probe(struct platform_device *op)
 
 	if (edac_device_add_device(edac_dev) > 0) {
 		edac_dbg(3, "failed edac_device_add_device()\n");
+		res = -EFAULT;
 		goto err;
 	}
 
-- 
2.25.1



             reply	other threads:[~2021-05-28  3:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28  3:26 Zhen Lei [this message]
2021-05-31  8:40 ` [PATCH 1/1] EDAC, mpc85xx: Fix error return code in two functions Borislav Petkov
2021-05-31  9:15   ` Leizhen (ThunderTown)
2021-05-31  9:23     ` Borislav Petkov

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=20210528032637.9231-1-thunder.leizhen@huawei.com \
    --to=thunder.leizhen@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=djiang@mvista.com \
    --cc=dougthompson@xmission.com \
    --cc=james.morse@arm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=morbidrsa@gmail.com \
    --cc=rric@kernel.org \
    --cc=tony.luck@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;
as well as URLs for NNTP newsgroup(s).