]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: imu: inv_icm45600: Add a missing return statement in probe()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 22 Oct 2025 11:02:20 +0000 (14:02 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 9 Nov 2025 12:57:04 +0000 (12:57 +0000)
The intention here was clearly to return -ENODEV but the return statement
was missing.  It would result in an off by one read in i3c_chip_info[] on
the next line.  Add the return statement.

Fixes: 1bef24e9007e ("iio: imu: inv_icm45600: add I3C driver for inv_icm45600 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/inv_icm45600/inv_icm45600_i3c.c

index b5df06b97d44e0e769a082751fdecd95cc10c5d8..9247eae9b3e24bfe86f89ff764612787a29f4a74 100644 (file)
@@ -57,7 +57,8 @@ static int inv_icm45600_i3c_probe(struct i3c_device *i3cdev)
        }
 
        if (chip == nb_chip)
-               dev_err_probe(&i3cdev->dev, -ENODEV, "Failed to match part id %d\n", whoami);
+               return dev_err_probe(&i3cdev->dev, -ENODEV,
+                                    "Failed to match part id %d\n", whoami);
 
        return inv_icm45600_core_probe(regmap, i3c_chip_info[chip], false, NULL);
 }