diff options
author | Dan Carpenter <[email protected]> | 2024-08-08 22:28:17 +0300 |
---|---|---|
committer | Jonathan Cameron <[email protected]> | 2024-08-10 11:34:27 +0100 |
commit | c5d2291a3086f4b59ae42d5082cfe45ef9103062 (patch) | |
tree | 0673a87413ccb17b30cad534ff9d8e203db88223 | |
parent | f2271ba6f0744a0175ed387577405697ee0360db (diff) |
iio: adc: pac1921: add missing error return in probe()
This error path was intended to return, and not just print an error. The
current code will lead to an error pointer dereference.
Fixes: 371f778b83cd ("iio: adc: add support for pac1921")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Matteo Martelli <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
-rw-r--r-- | drivers/iio/adc/pac1921.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/pac1921.c b/drivers/iio/adc/pac1921.c index d04c6685d780..8200a47bdf21 100644 --- a/drivers/iio/adc/pac1921.c +++ b/drivers/iio/adc/pac1921.c @@ -1168,8 +1168,8 @@ static int pac1921_probe(struct i2c_client *client) priv->regmap = devm_regmap_init_i2c(client, &pac1921_regmap_config); if (IS_ERR(priv->regmap)) - dev_err_probe(dev, (int)PTR_ERR(priv->regmap), - "Cannot initialize register map\n"); + return dev_err_probe(dev, (int)PTR_ERR(priv->regmap), + "Cannot initialize register map\n"); devm_mutex_init(dev, &priv->lock); |