All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] net: cpsw: add missing of_node_put() in cpsw_probe_dt()
@ 2022-04-26 12:47 Yang Yingliang
  2022-04-28  0:52 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Yang Yingliang @ 2022-04-26 12:47 UTC (permalink / raw)
  To: linux-kernel, netdev; +Cc: grygorii.strashko, davem, kuba

If devm_kcalloc() fails, 'tmp_node' should be put in cpsw_probe_dt().

Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/ethernet/ti/cpsw_new.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index bd4b1528cf99..b81179f7d738 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -1246,8 +1246,10 @@ static int cpsw_probe_dt(struct cpsw_common *cpsw)
 	data->slave_data = devm_kcalloc(dev, CPSW_SLAVE_PORTS_NUM,
 					sizeof(struct cpsw_slave_data),
 					GFP_KERNEL);
-	if (!data->slave_data)
+	if (!data->slave_data) {
+		of_node_put(tmp_node);
 		return -ENOMEM;
+	}
 
 	/* Populate all the child nodes here...
 	 */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] net: cpsw: add missing of_node_put() in cpsw_probe_dt()
  2022-04-26 12:47 [PATCH -next] net: cpsw: add missing of_node_put() in cpsw_probe_dt() Yang Yingliang
@ 2022-04-28  0:52 ` Jakub Kicinski
  2022-04-28  1:30   ` Yang Yingliang
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2022-04-28  0:52 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, netdev, grygorii.strashko, davem

On Tue, 26 Apr 2022 20:47:57 +0800 Yang Yingliang wrote:
> Subject: [PATCH -next] net: cpsw: add missing of_node_put() in cpsw_probe_dt()

Why next? The commit under Fixes is in Linus's tree.

Please sort this out and repost.

> If devm_kcalloc() fails, 'tmp_node' should be put in cpsw_probe_dt().
> 
> Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] net: cpsw: add missing of_node_put() in cpsw_probe_dt()
  2022-04-28  0:52 ` Jakub Kicinski
@ 2022-04-28  1:30   ` Yang Yingliang
  0 siblings, 0 replies; 3+ messages in thread
From: Yang Yingliang @ 2022-04-28  1:30 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: linux-kernel, netdev, grygorii.strashko, davem


On 2022/4/28 8:52, Jakub Kicinski wrote:
> On Tue, 26 Apr 2022 20:47:57 +0800 Yang Yingliang wrote:
>> Subject: [PATCH -next] net: cpsw: add missing of_node_put() in cpsw_probe_dt()
> Why next? The commit under Fixes is in Linus's tree.
>
> Please sort this out and repost.
It supposed to net, I write a wrong title, I will resend it.

Thanks,
Yang
>
>> If devm_kcalloc() fails, 'tmp_node' should be put in cpsw_probe_dt().
>>
>> Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> .

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-28  1:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 12:47 [PATCH -next] net: cpsw: add missing of_node_put() in cpsw_probe_dt() Yang Yingliang
2022-04-28  0:52 ` Jakub Kicinski
2022-04-28  1:30   ` Yang Yingliang

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.