diff options
| author | Carlo Szelinsky <github@szelinsky.de> | 2026-10-20 19:11:32 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-20 18:18:21 -0700 |
| commit | 70c29b35fd87f87a7b8dad6eb8d55ce54a0d549a (patch) | |
| tree | 891ebd68d9e046b7e37907e6c74328ae7c90216a /drivers | |
| parent | 599d0e97610f09162d84c4ede4164628c066921e (diff) | |
net: pse-pd: si3474: fix use-after-free in ancillary client error path
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.
Found by code inspection. Not reproduced.
Fixes: a2317231df4b ("net: pse-pd: Add Si3474 PSE controller driver")
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://patch.msgid.link/20261020171134.852878-2-github@szelinsky.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/pse-pd/si3474.c | 4 |
1 files changed, 1 insertions, 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) { |
