[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zd-na3oVV4Chl4Ft@smile.fi.intel.com>
Date: Wed, 28 Feb 2024 23:36:43 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: David Lechner <dlechner@...libre.com>
Cc: Vinod Koul <vkoul@...nel.org>, Linus Walleij <linus.walleij@...aro.org>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Mark Brown <broonie@...nel.org>, Kees Cook <keescook@...omium.org>,
linux-arm-kernel@...ts.infradead.org, dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
linux-spi@...r.kernel.org, netdev@...r.kernel.org,
linux-hardening@...r.kernel.org,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>
Subject: Re: [PATCH v4 3/8] iio: core: NULLify private pointer when there is
no private data
On Wed, Feb 28, 2024 at 03:06:42PM -0600, David Lechner wrote:
> On Wed, Feb 28, 2024 at 2:50 PM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
..
> > - indio_dev->priv = (char *)iio_dev_opaque +
> > - ALIGN(sizeof(struct iio_dev_opaque), IIO_DMA_MINALIGN);
> > +
> > + if (sizeof_priv)
> > + indio_dev->priv = (char *)iio_dev_opaque +
> > + ALIGN(sizeof(struct iio_dev_opaque), IIO_DMA_MINALIGN);
> > + else
> > + indio_dev->priv = NULL;
>
> Do we actually need the else branch here since we use kzalloc() and
> therefore indio_dev->priv should already be NULL?
This is more robust, but I'm okay to drop this. Up to Jonathan.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists