[PATCH v2] spi: bcm2835: fix device_node reference leak in bcm2835_spi_setup()
Bartosz Golaszewski
brgl at kernel.org
Mon Sep 28 01:31:28 PDT 2026
On Fri, 25 Sep 2026 21:30:08 +0200, Lucas Costa
<2000.costalucas at gmail.com> said:
> of_find_compatible_node() returns a device_node with its reference count
> incremented, but bcm2835_spi_setup() only uses the return value to test
> for a matching node in the loop and never releases it.
>
> Declare the node with a scope-based __free(device_node) cleanup so the
> reference is dropped automatically when leaving the loop body, matching
> the existing __free(kfree) usage in the same function.
>
> Fixes: e19c1272c80a ("spi: bcm2835: Restore native CS probing when pinctrl-bcm2835 is absent")
> Cc: stable at vger.kernel.org
> Signed-off-by: Lucas Costa <2000.costalucas at gmail.com>
> ---
As Mark said: don't send new versions in response to older versions.
In any case:
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski at oss.qualcomm.com>
More information about the linux-arm-kernel
mailing list