diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-02-16 23:03:37 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-02-19 09:00:56 +0100 |
commit | 70b782b6b222993b5ec63f6bcb53dcf5f721f42d (patch) | |
tree | 47f9ebd83754ddb150696730af53b84572982793 | |
parent | 1db4fae6e97cbd57f10e179daa2f65dd34566113 (diff) | |
download | barebox-70b782b6b222.tar.gz barebox-70b782b6b222.tar.xz |
i2c: don't return error pointers from of_find_i2c_adapter_by_node
All callers of of_find_i2c_adapter_by_node expect errors to be indicated
by NULL and don't check non-NULL pointers with IS_ERR().
Therefore map of_device_ensure_probed() errors to NULL as well to avoid
dereferencing error pointers.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20240216220337.2327115-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/i2c/i2c.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c index 70d1b810c1..1985ddfdc7 100644 --- a/drivers/i2c/i2c.c +++ b/drivers/i2c/i2c.c @@ -593,7 +593,7 @@ struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node) ret = of_device_ensure_probed(node); if (ret) - return ERR_PTR(ret); + return NULL; for_each_i2c_adapter(adap) if (adap->dev.of_node == node) |