[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3O1V4FAACa9Ed9S@lunn.ch>
Date: Tue, 15 Nov 2022 16:50:47 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Hui Tang <tanghui20@...wei.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
mw@...ihalf.com, linux@...linux.org.uk, leon@...nel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
yusongping@...wei.com
Subject: Re: [PATCH net v2] net: mvpp2: fix possible invalid pointer
dereference
On Tue, Nov 15, 2022 at 05:04:33PM +0800, Hui Tang wrote:
> It will cause invalid pointer dereference to priv->cm3_base behind,
> if PTR_ERR(priv->cm3_base) in mvpp2_get_sram().
As i pointed out for the MDIO driver, i wonder if this is the correct
fix. mvpp2_get_sram() is probably a better place to handle this
In fact, please add a devm_ioremap_resource_optional() which returns
NULL if the resource does not exist, or an error code for real errors,
and make drivers fail the probe on real errors.
Andrew
Powered by blists - more mailing lists