Commit c5d2291a authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron

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: 371f778b ("iio: adc: add support for pac1921")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Acked-by: default avatarMatteo Martelli <matteomartelli3@gmail.com>
Link: https://patch.msgid.link/1fa4ab12-0939-477d-bc92-306fd32e4fd9@stanley.mountainSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent f2271ba6
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment