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] [thread-next>] [day] [month] [year] [list]
Message-Id: <ADU3KR.HZPTLZCKPHT63@crapouillou.net>
Date:   Fri, 21 Oct 2022 14:19:58 +0100
From:   Paul Cercueil <paul@...pouillou.net>
To:     Pavel Machek <pavel@....cz>
Cc:     linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
        Andy Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [PATCH v2] leds: max8997: Don't error if there is no pdata



Le ven. 21 oct. 2022 à 15:11:45 +0200, Pavel Machek <pavel@....cz> a 
écrit :
> On Thu 2022-10-20 12:44:42, Paul Cercueil wrote:
>>  The driver works just fine if no platform data is supplied.
>> 
>>  Signed-off-by: Paul Cercueil <paul@...pouillou.net>
>>  Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
> 
> Does it? Bad Paul, bad Andy.

Yes, it does.

>>  +++ b/drivers/leds/leds-max8997.c
>>  @@ -238,11 +238,6 @@ static int max8997_led_probe(struct 
>> platform_device *pdev)
>>   	char name[20];
>>   	int ret = 0;
>> 
>>  -	if (pdata == NULL) {
>>  -		dev_err(&pdev->dev, "no platform data\n");
>>  -		return -ENODEV;
>>  -	}
>>  -
>>   	led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL);
>>   	if (led == NULL)
>>   		return -ENOMEM;
>>  @@ -258,7 +253,7 @@ static int max8997_led_probe(struct 
>> platform_device *pdev)
>>   	led->iodev = iodev;
>> 
>>   	/* initialize mode and brightness according to platform_data */
>>  -	if (pdata->led_pdata) {
>>  +	if (pdata && pdata->led_pdata) {
>>   		u8 mode = 0, brightness = 0;
>> 
>>   		mode = pdata->led_pdata->mode[led->id];
> 
> I see pdata being dereferenced here.

Oh really. Look again.

-Paul


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ