Re: [PATCH] dma: qcom: hidma_mgmt: Add of_node_put() before goto

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

 



On 7/23/2019 8:02 AM, Robin Murphy wrote:
> Why not just add it once at the "out" label itself? (Consider the
> conditions for the loop terminating naturally)
> 

+1

>>
>> Signed-off-by: Nishka Dasgupta <nishkadg.linux@xxxxxxxxx>
>> ---
>>   drivers/dma/qcom/hidma_mgmt.c | 13 ++++++++++---
>>   1 file changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/dma/qcom/hidma_mgmt.c
>> b/drivers/dma/qcom/hidma_mgmt.c
>> index 3022d66e7a33..209adc6ceabe 100644
>> --- a/drivers/dma/qcom/hidma_mgmt.c
>> +++ b/drivers/dma/qcom/hidma_mgmt.c
>> @@ -362,16 +362,22 @@ static int __init
>> hidma_mgmt_of_populate_channels(struct device_node *np)
>>           struct platform_device *new_pdev;
>>             ret = of_address_to_resource(child, 0, &res[0]);
>> -        if (!ret)
>> +        if (!ret) {
>> +            of_node_put(child);

The spacing on this also looks weird.

>>               goto out;
>> +        } 




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux