diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2015-02-12 23:58:41 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-18 14:10:58 +0100 |
commit | dc77d1f2ff85e75ff2c9ac3ec462116468f98a63 (patch) | |
tree | 4593b9f7250dbbcbcdc7fe07031ab723fcc656bb /drivers | |
parent | f3b2ffcff53dbd5358c04c1d8582dcf5b3421643 (diff) |
IIO: si7020: Allocate correct amount of memory in devm_iio_device_alloc
commit e01becbad300712a28f29b666e685536f45e83bc upstream.
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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/humidity/si7020.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c index b54164677b89..8e7f9f314fec 100644 --- a/drivers/iio/humidity/si7020.c +++ b/drivers/iio/humidity/si7020.c @@ -126,7 +126,7 @@ static int si7020_probe(struct i2c_client *client, /* Wait the maximum power-up time after software reset. */ msleep(15); - indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*client)); + indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); if (!indio_dev) return -ENOMEM; |