* RE: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-09 9:58 ` 王擎
0 siblings, 0 replies; 13+ messages in thread
From: 王擎 @ 2021-12-09 9:58 UTC (permalink / raw)
To: Mark Brown
Cc: Nicolin Chen, Xiubo Li, Fabio Estevam, Shengjiu Wang,
Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, NXP Linux Team,
alsa-devel, linuxppc-dev, linux-arm-kernel, linux-kernel
>> 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;
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-09 9:58 ` 王擎
0 siblings, 0 replies; 13+ messages in thread
From: 王擎 @ 2021-12-09 9:58 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel, linuxppc-dev, linux-kernel, Xiubo Li, Fabio Estevam,
Sascha Hauer, Takashi Iwai, Liam Girdwood, Nicolin Chen,
NXP Linux Team, Pengutronix Kernel Team, Shawn Guo,
Shengjiu Wang, linux-arm-kernel
>> 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;
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-09 9:58 ` 王擎
0 siblings, 0 replies; 13+ messages in thread
From: 王擎 @ 2021-12-09 9:58 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel, linuxppc-dev, linux-kernel, Xiubo Li, Fabio Estevam,
Sascha Hauer, Takashi Iwai, Liam Girdwood, Jaroslav Kysela,
Nicolin Chen, NXP Linux Team, Pengutronix Kernel Team, Shawn Guo,
Shengjiu Wang, linux-arm-kernel
>> 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;
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
2021-12-09 9:58 ` 王擎
(?)
(?)
@ 2021-12-20 11:33 ` Shengjiu Wang
-1 siblings, 0 replies; 13+ messages in thread
From: Shengjiu Wang @ 2021-12-20 11:33 UTC (permalink / raw)
To: 王擎
Cc: Mark Brown, Nicolin Chen, Xiubo Li, Fabio Estevam, Liam Girdwood,
Jaroslav Kysela, Takashi Iwai, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, NXP Linux Team, alsa-devel,
linuxppc-dev, linux-arm-kernel, linux-kernel
On Thu, Dec 9, 2021 at 5:58 PM 王擎 <wangqing@vivo.com> wrote:
>
>
> >> 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.
>
I agree with you. But could you please add the info in this
commit that
the commit:
f670b274f7f6 ASoC: imx-hdmi: add put_device() after of_find_device_by_node()
is partially fixing the original issue, so we still need this fix.
Best regards
Wang Shengjiu
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-20 11:33 ` Shengjiu Wang
0 siblings, 0 replies; 13+ messages in thread
From: Shengjiu Wang @ 2021-12-20 11:33 UTC (permalink / raw)
To: 王擎
Cc: alsa-devel, linuxppc-dev, linux-kernel, Xiubo Li, Shawn Guo,
Sascha Hauer, Takashi Iwai, Liam Girdwood, Jaroslav Kysela,
Nicolin Chen, Mark Brown, NXP Linux Team,
Pengutronix Kernel Team, Fabio Estevam, linux-arm-kernel
On Thu, Dec 9, 2021 at 5:58 PM 王擎 <wangqing@vivo.com> wrote:
>
>
> >> 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.
>
I agree with you. But could you please add the info in this
commit that
the commit:
f670b274f7f6 ASoC: imx-hdmi: add put_device() after of_find_device_by_node()
is partially fixing the original issue, so we still need this fix.
Best regards
Wang Shengjiu
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-20 11:33 ` Shengjiu Wang
0 siblings, 0 replies; 13+ messages in thread
From: Shengjiu Wang @ 2021-12-20 11:33 UTC (permalink / raw)
To: 王擎
Cc: alsa-devel, linuxppc-dev, linux-kernel, Xiubo Li, Shawn Guo,
Sascha Hauer, Takashi Iwai, Liam Girdwood, Nicolin Chen,
Mark Brown, NXP Linux Team, Pengutronix Kernel Team,
Fabio Estevam, linux-arm-kernel
On Thu, Dec 9, 2021 at 5:58 PM 王擎 <wangqing@vivo.com> wrote:
>
>
> >> 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.
>
I agree with you. But could you please add the info in this
commit that
the commit:
f670b274f7f6 ASoC: imx-hdmi: add put_device() after of_find_device_by_node()
is partially fixing the original issue, so we still need this fix.
Best regards
Wang Shengjiu
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-20 11:33 ` Shengjiu Wang
0 siblings, 0 replies; 13+ messages in thread
From: Shengjiu Wang @ 2021-12-20 11:33 UTC (permalink / raw)
To: 王擎
Cc: Mark Brown, Nicolin Chen, Xiubo Li, Fabio Estevam, Liam Girdwood,
Jaroslav Kysela, Takashi Iwai, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, NXP Linux Team, alsa-devel,
linuxppc-dev, linux-arm-kernel, linux-kernel
On Thu, Dec 9, 2021 at 5:58 PM 王擎 <wangqing@vivo.com> wrote:
>
>
> >> 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.
>
I agree with you. But could you please add the info in this
commit that
the commit:
f670b274f7f6 ASoC: imx-hdmi: add put_device() after of_find_device_by_node()
is partially fixing the original issue, so we still need this fix.
Best regards
Wang Shengjiu
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
2021-12-07 12:56 ` Qing Wang
(?)
(?)
@ 2021-12-08 14:05 ` Mark Brown
-1 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2021-12-08 14:05 UTC (permalink / raw)
To: Qing Wang
Cc: Nicolin Chen, Xiubo Li, Fabio Estevam, Shengjiu Wang,
Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, NXP Linux Team,
alsa-devel, linuxppc-dev, linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 467 bytes --]
On Tue, Dec 07, 2021 at 04:56:58AM -0800, Qing Wang wrote:
> 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-08 14:05 ` Mark Brown
0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2021-12-08 14:05 UTC (permalink / raw)
To: Qing Wang
Cc: alsa-devel, linuxppc-dev, linux-kernel, Xiubo Li, Fabio Estevam,
Sascha Hauer, Takashi Iwai, Liam Girdwood, Nicolin Chen,
NXP Linux Team, Pengutronix Kernel Team, Shawn Guo,
Shengjiu Wang, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 467 bytes --]
On Tue, Dec 07, 2021 at 04:56:58AM -0800, Qing Wang wrote:
> 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-08 14:05 ` Mark Brown
0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2021-12-08 14:05 UTC (permalink / raw)
To: Qing Wang
Cc: alsa-devel, linuxppc-dev, linux-kernel, Xiubo Li, Fabio Estevam,
Sascha Hauer, Takashi Iwai, Liam Girdwood, Jaroslav Kysela,
Nicolin Chen, NXP Linux Team, Pengutronix Kernel Team, Shawn Guo,
Shengjiu Wang, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 467 bytes --]
On Tue, Dec 07, 2021 at 04:56:58AM -0800, Qing Wang wrote:
> 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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-08 14:05 ` Mark Brown
0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2021-12-08 14:05 UTC (permalink / raw)
To: Qing Wang
Cc: Nicolin Chen, Xiubo Li, Fabio Estevam, Shengjiu Wang,
Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, NXP Linux Team,
alsa-devel, linuxppc-dev, linux-arm-kernel, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 467 bytes --]
On Tue, Dec 07, 2021 at 04:56:58AM -0800, Qing Wang wrote:
> 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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-07 12:56 ` Qing Wang
0 siblings, 0 replies; 13+ messages in thread
From: Qing Wang @ 2021-12-07 12:56 UTC (permalink / raw)
To: Nicolin Chen, Xiubo Li, Fabio Estevam, Shengjiu Wang,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, NXP Linux Team,
alsa-devel, linuxppc-dev, linux-arm-kernel, linux-kernel
Cc: Wang Qing
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.
Signed-off-by: Wang Qing <wangqing@vivo.com>
---
sound/soc/fsl/imx-hdmi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/fsl/imx-hdmi.c b/sound/soc/fsl/imx-hdmi.c
index 929f69b..89fd8ad
--- a/sound/soc/fsl/imx-hdmi.c
+++ b/sound/soc/fsl/imx-hdmi.c
@@ -125,6 +125,7 @@ static int imx_hdmi_probe(struct platform_device *pdev)
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data) {
+ put_device(&cpu_pdev->dev);
ret = -ENOMEM;
goto fail;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe()
@ 2021-12-07 12:56 ` Qing Wang
0 siblings, 0 replies; 13+ messages in thread
From: Qing Wang @ 2021-12-07 12:56 UTC (permalink / raw)
To: Nicolin Chen, Xiubo Li, Fabio Estevam, Shengjiu Wang,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, NXP Linux Team,
alsa-devel, linuxppc-dev, linux-arm-kernel, linux-kernel
Cc: Wang Qing
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.
Signed-off-by: Wang Qing <wangqing@vivo.com>
---
sound/soc/fsl/imx-hdmi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/fsl/imx-hdmi.c b/sound/soc/fsl/imx-hdmi.c
index 929f69b..89fd8ad
--- a/sound/soc/fsl/imx-hdmi.c
+++ b/sound/soc/fsl/imx-hdmi.c
@@ -125,6 +125,7 @@ static int imx_hdmi_probe(struct platform_device *pdev)
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data) {
+ put_device(&cpu_pdev->dev);
ret = -ENOMEM;
goto fail;
}
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 13+ messages in thread
end of thread, other threads:[~2021-12-20 11:36 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 9:58 [PATCH] sound: fsl: add missing put_device() call in imx_hdmi_probe() 王擎
2021-12-09 9:58 ` 王擎
2021-12-09 9:58 ` 王擎
2021-12-20 11:33 ` Shengjiu Wang
2021-12-20 11:33 ` Shengjiu Wang
2021-12-20 11:33 ` Shengjiu Wang
2021-12-20 11:33 ` Shengjiu Wang
-- strict thread matches above, loose matches on Subject: below --
2021-12-07 12:56 Qing Wang
2021-12-07 12:56 ` Qing Wang
2021-12-08 14:05 ` Mark Brown
2021-12-08 14:05 ` Mark Brown
2021-12-08 14:05 ` Mark Brown
2021-12-08 14:05 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.