[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a406ef56-bcb7-4d12-9666-2f354bdba3dd@kernel.org>
Date: Mon, 14 Oct 2024 10:51:30 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Dan Carpenter <dan.carpenter@...aro.org>,
Javier Carrasco <javier.carrasco.cruz@...il.com>
Cc: Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Stefan Wahren <wahrenst@....net>, Umang Jain <umang.jain@...asonboard.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
linux-rpi-kernel@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] staging: vchiq_arm: Fix missing refcount decrement in
error path for fw_node
On 14/10/2024 09:22, Dan Carpenter wrote:
>> @@ -1341,8 +1342,6 @@ static int vchiq_probe(struct platform_device *pdev)
>> if (!info)
>> return -EINVAL;
>>
>> - fw_node = of_find_compatible_node(NULL, NULL,
>> - "raspberrypi,bcm2835-firmware");
>
> Perhaps it's better to declare the variable here so that the function and the
> error handling are next to each other.
>
> if (!info)
> return -EINVAL;
>
> struct device_node *fw_node __free(device_node) =
> of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-firmware");
> if (!fw_node) {
>
> ...
>
> This is why we lifted the rule that variables had to be declared at the start
> of a function.
>
Ack, this is how this should look like.
Best regards,
Krzysztof
Powered by blists - more mailing lists