lkml.org 
[lkml]   [2021]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
Date

>> From: Wang Qing <wangqing@vivo.com>
>>
>> of_find_device_by_node() takes a reference to the embedded struct device
>> which needs to be dropped when error return.
>
>...
>
>>        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
>>        if (!data) {
>> +             put_device(&cpu_pdev->dev);
>
>If it's of_find_device_by_node() you need an of_node_put() since you're
>dropping a reference on the OF node.
>

Label fail will drop a reference on the OF node.
Also, put_device() is called later except this branch,
we just need to add put_device() here.

Thanks,
Qing

>> ret = -ENOMEM;
>> goto fail;
\
 
 \ /
  Last update: 2021-12-09 10:59    [W:0.029 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site