On Sat, 1 May 2021 22:27:22 +0300 Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote: > On Sat, May 1, 2021 at 10:25 PM Andy Shevchenko > <andy.shevchenko@xxxxxxxxx> wrote: > > On Sat, May 1, 2021 at 8:28 PM Jonathan Cameron <jic23@xxxxxxxxxx> wrote: > > ... > > > > + iio_dev_opaque->bounce_buffer = > > > + devm_krealloc(&indio_dev->dev, > > > + iio_dev_opaque->bounce_buffer, > > > > Oh la la, foo = realloc(foo, ...) is 101 type of mistakes. > > Please, don't do this. > > > > > + indio_dev->scan_bytes, GFP_KERNEL); > > > + if (!iio_dev_opaque) > > And this check... Yup. Thoroughly broken. Hohum, but basic idea conveyed however bad the rfc was :( > > > > + return -ENOMEM; > > > + } >