lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1eec11c9-d2f2-45fb-ad7b-6b33bd62cf04@csgroup.eu>
Date: Mon, 25 Aug 2025 08:21:24 +0200
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Markus Elfring <Markus.Elfring@....de>,
 Salah Triki <salah.triki@...il.com>, linuxppc-dev@...ts.ozlabs.org,
 Ioana Ciornei <ioana.ciornei@....com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] bus: fsl-mc: Check return value of
 platform_get_resource()



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
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ