Re: [PATCH v2] spi: bcm2835: fix device_node reference leak in bcm2835_spi_setup()

From: Bartosz Golaszewski

Date: Mon Sep 28 2026 - 04:34:54 EST


On Fri, 25 Sep 2026 21:30:08 +0200, Lucas Costa
<2000.costalucas@xxxxxxxxx> 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@xxxxxxxxxxxxxxx
> Signed-off-by: Lucas Costa <2000.costalucas@xxxxxxxxx>
> ---

As Mark said: don't send new versions in response to older versions.

In any case:

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>