lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 9 Dec 2021 09:58:52 +0000
From:   王擎 <wangqing@...o.com>
To:     Mark Brown <broonie@...nel.org>
CC:     Nicolin Chen <nicoleotsuka@...il.com>,
        Xiubo Li <Xiubo.Lee@...il.com>,
        Fabio Estevam <festevam@...il.com>,
        Shengjiu Wang <shengjiu.wang@...il.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        NXP Linux Team <linux-imx@....com>,
        "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] sound: fsl: add missing put_device() call in
 imx_hdmi_probe()


>> From: Wang Qing <wangqing@...o.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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ