lkml.org 
[lkml]   [2021]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5.10 073/593] iio: light: tcs3472: do not free unallocated IRQ
Hi!

> commit 7cd04c863f9e1655d607705455e7714f24451984 upstream.
>
> Allocating an IRQ is conditional to the IRQ existence, but freeing it
> was not. If no IRQ was allocate, the driver would still try to free
> IRQ 0. Add the missing checks.
>
> This fixes the following trace when the driver is removed:
>
> [ 100.667788] Trying to free already-free IRQ 0

AFAICT this will need more fixing, because IRQ == 0 is a valid
IRQ. NO_IRQ (aka -1) should be safe to use for "no irq assigned".

Best regards,
Pavel

> +++ b/drivers/iio/light/tcs3472.c
> @@ -531,7 +531,8 @@ static int tcs3472_probe(struct i2c_clie
> return 0;
>
> free_irq:
> - free_irq(client->irq, indio_dev);
> + if (client->irq)
> + free_irq(client->irq, indio_dev);
> buffer_cleanup:
> iio_triggered_buffer_cleanup(indio_dev);
> return ret;

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-07-13 23:32    [W:1.869 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site