staging/iio: Use correct argument for sizeof
found with coccicheck sizeof when applied to a pointer typed expression gives the size of the pointer The semantic patch that makes this output is available in scripts/coccinelle/misc/noderef.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
81ca486fe5
commit
232827fb81
1 changed files with 1 additions and 1 deletions
|
@ -93,7 +93,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
|
||||||
while (st->channels[st->num_channels].indio_dev)
|
while (st->channels[st->num_channels].indio_dev)
|
||||||
st->num_channels++;
|
st->num_channels++;
|
||||||
|
|
||||||
st->attrs = kzalloc(sizeof(st->attrs) * (st->num_channels + 1),
|
st->attrs = kzalloc(sizeof(*st->attrs) * (st->num_channels + 1),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (st->attrs == NULL) {
|
if (st->attrs == NULL) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
|
Loading…
Reference in a new issue