Skip to content

Commit

Permalink
staging/iio: Use correct argument for sizeof
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Huewe authored and Jonathan Cameron committed Jan 26, 2013
1 parent 81ca486 commit 232827f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/iio_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
while (st->channels[st->num_channels].indio_dev)
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);
if (st->attrs == NULL) {
ret = -ENOMEM;
Expand Down

0 comments on commit 232827f

Please sign in to comment.