]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
iio: magnetometer: yas530: Fix return value on error path
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 15 Feb 2021 15:30:23 +0000 (16:30 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 7 Apr 2021 07:36:40 +0000 (08:36 +0100)
There was a missed return variable assignment in the
default errorpath of the switch statement in yas5xx_probe().
Fix it.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210215153023.47899-1-linus.walleij@linaro.org
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/yamaha-yas530.c

index d46f23d82b3da296cd5caa5b9027400f46f76bc5..cee6207d8847c9cdbad065da2d4d0453ad4ae797 100644 (file)
@@ -887,6 +887,7 @@ static int yas5xx_probe(struct i2c_client *i2c,
                strncpy(yas5xx->name, "yas532", sizeof(yas5xx->name));
                break;
        default:
+               ret = -ENODEV;
                dev_err(dev, "unhandled device ID %02x\n", yas5xx->devid);
                goto assert_reset;
        }