Skip to content

Commit

Permalink
staging:iio:dac: Fix kcalloc parameters swapped
Browse files Browse the repository at this point in the history
The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Axel Lin authored and Greg Kroah-Hartman committed Feb 14, 2012
1 parent 5f01f7f commit 09f993e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/iio/dac/ad5360.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ static int __devinit ad5360_alloc_channels(struct iio_dev *indio_dev)
struct iio_chan_spec *channels;
unsigned int i;

channels = kcalloc(sizeof(struct iio_chan_spec),
st->chip_info->num_channels, GFP_KERNEL);
channels = kcalloc(st->chip_info->num_channels,
sizeof(struct iio_chan_spec), GFP_KERNEL);

if (!channels)
return -ENOMEM;
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/iio/dac/ad5380.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ static int __devinit ad5380_alloc_channels(struct iio_dev *indio_dev)
struct iio_chan_spec *channels;
unsigned int i;

channels = kcalloc(sizeof(struct iio_chan_spec),
st->chip_info->num_channels, GFP_KERNEL);
channels = kcalloc(st->chip_info->num_channels,
sizeof(struct iio_chan_spec), GFP_KERNEL);

if (!channels)
return -ENOMEM;
Expand Down

0 comments on commit 09f993e

Please sign in to comment.