Messages in this thread | | | Date | Tue, 15 Nov 2022 16:50:47 +0100 | From | Andrew Lunn <> | 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
| |