[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200916.172153.376464259253056720.davem@davemloft.net>
Date: Wed, 16 Sep 2020 17:21:53 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: olteanv@...il.com
Cc: netdev@...r.kernel.org, yangbo.lu@....com,
xiaoliang.yang_1@....com, UNGLinuxDriver@...rochip.com,
claudiu.manoil@....com, alexandre.belloni@...tlin.com,
andrew@...n.ch, vivien.didelot@...il.com, f.fainelli@...il.com,
kuba@...nel.org
Subject: Re: [PATCH net 4/7] net: mscc: ocelot: check for errors on memory
allocation of ports
From: Vladimir Oltean <olteanv@...il.com>
Date: Tue, 15 Sep 2020 21:22:26 +0300
> @@ -993,6 +993,8 @@ static int mscc_ocelot_probe(struct platform_device *pdev)
>
> ocelot->ports = devm_kcalloc(&pdev->dev, ocelot->num_phys_ports,
> sizeof(struct ocelot_port *), GFP_KERNEL);
> + if (!ocelot->ports)
> + return -ENOMEM;
This leaks the reference to OF node 'ports'.
Powered by blists - more mailing lists