linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Markus Elfring <Markus.Elfring@web.de>,
	Salah Triki <salah.triki@gmail.com>,
	linuxppc-dev@lists.ozlabs.org,
	Ioana Ciornei <ioana.ciornei@nxp.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] bus: fsl-mc: Check return value of platform_get_resource()
Date: Mon, 25 Aug 2025 08:21:24 +0200	[thread overview]
Message-ID: <1eec11c9-d2f2-45fb-ad7b-6b33bd62cf04@csgroup.eu> (raw)
In-Reply-To: <b107c2a6-bb56-4b15-bf0f-d9eca8163aa1@web.de>



Le 27/07/2025 à 18:24, Markus Elfring a écrit :
>> platform_get_resource() returns NULL in case of failure, so check its
>> return value and propagate the error in order to prevent NULL pointer
>> dereference.
> 
> How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16-rc7#n145
> 

Fixes: 6305166c8771 ("bus: fsl-mc: Add ACPI support for fsl-mc")

> 
> …
>> +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
>> @@ -1105,6 +1105,10 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
>>   	 * Get physical address of MC portal for the root DPRC:
>>   	 */
>>   	plat_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> +
>> +	if (!plat_res)
>> +		return -ENODEV;

Before the blame commit, of_address_to_resource() was used and 
of_address_to_resource() returns -EINVAL in case no resource is found. 
Should we keep the same return instead of ENODEV ?

> …
> 
> I suggest to omit a blank line before the if statement.
> 
> Regards,
> Markus
> 
> 



      reply	other threads:[~2025-08-25  6:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-24  9:11 [PATCH] bus: fsl-mc: Check return value of platform_get_resource() Salah Triki
2025-07-27 16:24 ` Markus Elfring
2025-08-25  6:21   ` Christophe Leroy [this message]

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=1eec11c9-d2f2-45fb-ad7b-6b33bd62cf04@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=Markus.Elfring@web.de \
    --cc=ioana.ciornei@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=salah.triki@gmail.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).