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: <CAHp75VdHEVsj9o1UPSS1ikJYofDuiA7KwUaj8v79cJ3Xs=N5xw@mail.gmail.com>
Date: Tue, 9 Dec 2025 16:14:03 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Kate Hsuan <hpa@...hat.com>, Lee Jones <lee@...nel.org>, Pavel Machek <pavel@...nel.org>, 
	Sakari Ailus <sakari.ailus@...ux.intel.com>, 
	Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>, 
	Jonathan Cameron <jonathan.cameron@...wei.com>, Hans de Goede <hansg@...nel.org>, 
	Andy Shevchenko <andy@...nel.org>, linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org, 
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] leds: rgb: leds-ktd202x: Fix error code in ktd202x_setup_led_rgb()

On Tue, Dec 9, 2025 at 8:56 AM Dan Carpenter <dan.carpenter@...aro.org> wrote:
>
> Return -EINVAL if the "reg" value is invalid.  This is unlikely to
> happen in real life because it comes from the firmware, whether from
> device tree or ACPI.

...

>                 if (ret != 0 || reg >= chip->num_leds) {
>                         dev_err(chip->dev, "invalid 'reg' of %pfw\n", child);
>                         fwnode_handle_put(child);
> -                       return ret;
> +                       return ret ?: -EINVAL;
>                 }

I think the better fix is to split the original conditional to two.

And make the message something like
"can't retrieve 'reg' property of %pfw\n'
for the case if (ret).

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ