Re: [PATCH 2/2] hwmon: chipcap2: fix return path in cc2_request_alarm_irqs()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 07, 2024 at 10:17:09PM +0100, Javier Carrasco wrote:
> The return path can be improved by returning upon first failure. The
> current implementation would try to register the second interrupt even
> if the first one failed, which is unnecessary.
> 
> Moreover, if no irqs are available, the return value should be zero
> (the driver supports the use case with no interrupts). Currently the
> initial value is unassigned and that may lead to returning an unknown
> value if stack variables are not automatically set to zero and no irqs
> were provided.
> 
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Closes: https://lore.kernel.org/linux-hwmon/294e4634-89d4-415e-a723-b208d8770d7c@xxxxxxxxx/T/#t
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>

Applied.

Thanks,
Guenter




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux