Skip to content

Commit

Permalink
IIO: si7020: Allocate correct amount of memory in devm_iio_device_alloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrey Smirnov authored and Jonathan Cameron committed Feb 14, 2015
1 parent e765537 commit e01becb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/humidity/si7020.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit e01becb

Please sign in to comment.