Thread (5 messages) 5 messages, 5 authors, 2025-09-20

Re: [PATCH net-next] net: ti: icssm-prueth: unwind cleanly in probe()

From: Simon Horman <horms@kernel.org>
Date: 2025-09-18 16:28:01
Also in: kernel-janitors, linux-arm-kernel, lkml

On Thu, Sep 18, 2025 at 12:48:26PM +0300, Dan Carpenter wrote:
This error handling triggers a Smatch warning:

    drivers/net/ethernet/ti/icssm/icssm_prueth.c:1574 icssm_prueth_probe()
    warn: 'prueth->pru1' is an error pointer or valid

The warning is harmless because the pru_rproc_put() function has an
IS_ERR_OR_NULL() check built in.  However, there is a small bug if
syscon_regmap_lookup_by_phandle() fails.  In that case we should call
of_node_put() on eth0_node and eth1_node.

It's a little bit easier to re-write this code to only free things which
we know have been allocated successfully.

Fixes: 511f6c1ae093 ("net: ti: icssm-prueth: Adds ICSSM Ethernet driver")
Signed-off-by: Dan Carpenter <redacted>
Thanks Dan.

I'm pretty sure I reviewed this code at some point.
Sorry for not noticing this problem then.

Reviewed-by: Simon Horman <horms@kernel.org>

...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help