Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

IIO: si7020: Allocate correct amount of memory in devm_iio_device_alloc

Since only a pointer to struct i2c_client is stored in a private area
of IIO device created by the driver there's no need to allocate
sizeof(struct i2c_client) worth of storage.

Pushed to stable as this is linked to the revert patch previously.
Without this followup the original patch looks sensible.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Andrey Smirnov and committed by
Jonathan Cameron
e01becba e765537a

+1 -1
+1 -1
drivers/iio/humidity/si7020.c
··· 126 126 /* Wait the maximum power-up time after software reset. */ 127 127 msleep(15); 128 128 129 - indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*client)); 129 + indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); 130 130 if (!indio_dev) 131 131 return -ENOMEM; 132 132