Thread (37 messages) 37 messages, 6 authors, 1d ago

Re: [PATCH net 09/10] net: pse-pd: si3474: fix use-after-free in ancillary client error path

flat view

From: Kory Maincent <kory.maincent@bootlin.com>
Date: 2026-10-19 12:50:40
Also in: lkml


On 10/18/26 10:23, Carlo Szelinsky wrote:
If devm_add_action_or_reset() fails, it has already unregistered the
ancillary I2C client, and the error message then reads that client's
device. It can only fail with -ENOMEM, which is already reported, so
drop the message.
That's not really a fix but well:
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Thank you!
quoted hunk ↗ jump to hunk
Fixes: a2317231df4b ("net: pse-pd: Add Si3474 PSE controller driver")
Signed-off-by: Carlo Szelinsky <redacted>
---
  drivers/net/pse-pd/si3474.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/pse-pd/si3474.c b/drivers/net/pse-pd/si3474.c
index 1845b9c51cf7..2f4f241a48af 100644
--- a/drivers/net/pse-pd/si3474.c
+++ b/drivers/net/pse-pd/si3474.c
@@ -516,10 +516,8 @@ static int si3474_i2c_probe(struct i2c_client *client)
  		return PTR_ERR(priv->client[1]);
  
  	ret = devm_add_action_or_reset(dev, si3474_ancillary_i2c_remove, priv->client[1]);
-	if (ret < 0) {
-		dev_err(&priv->client[1]->dev, "Cannot register remove callback\n");
+	if (ret)
  		return ret;
-	}
  
  	ret = i2c_smbus_read_byte_data(priv->client[1], VENDOR_IC_ID_REG);
  	if (ret < 0) {
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help