From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Johannes Thumshirn <morbidrsa@gmail.com>,
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>
Subject: Re: [PATCH 1/1] EDAC, mpc85xx: Fix error return code in two functions
Date: Mon, 31 May 2021 17:15:54 +0800 [thread overview]
Message-ID: <daec460d-754c-d904-f81c-91bdfaccefad@huawei.com> (raw)
In-Reply-To: <YLSg/8REPQoX8HL7@zn.tnic>
On 2021/5/31 16:40, Borislav Petkov wrote:
> On Fri, May 28, 2021 at 11:26:37AM +0800, Zhen Lei wrote:
>> 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;
>> }
>>
>> --
>
> EFAULT means
>
> #define EFAULT 14 /* Bad address */
>
> Does it make sense to you when the probe function returns a "bad
> address" upon failure to add a device?
>
> hint 1: you might wanna audit how the other drivers are calling this for
> better ideas.
So how about change to -ENODEV?
>
> hint 2: while doing hint 1, you might find some more broken cases which
> you could fix too.
OK, I will find and fix all of them. Thanks for your hint.
>
> Thx.
>
next prev parent reply other threads:[~2021-05-31 9:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-28 3:26 [PATCH 1/1] EDAC, mpc85xx: Fix error return code in two functions Zhen Lei
2021-05-31 8:40 ` Borislav Petkov
2021-05-31 9:15 ` Leizhen (ThunderTown) [this message]
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=daec460d-754c-d904-f81c-91bdfaccefad@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