Re: [PATCH v3] iio: common: st_sensors: fix possible infinite loop in st_sensors_irq_thread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 8, 2020 at 4:38 PM Lorenzo Bianconi <lorenzo@xxxxxxxxxx> wrote:
>
> Return a boolean value in st_sensors_new_samples_available routine in
> order to avoid an infinite loop in st_sensors_irq_thread if
> stat_drdy.addr is not defined or stat_drdy read fails

...

> +               if (!sdata->sensor_settings->drdy_irq.stat_drdy.addr) {
> +                       dev_err(&indio_dev->dev,
> +                               "edge IRQ not supported w/o stat register.\n");


> +                       err = -EOPNOTSUPP;

Wrong error code. You must not return it to user space (or you should
fix all call sites to be sure this won't be returned).

> +                       goto iio_trigger_free;
> +               }

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux