staging:iio:dac: Fix kcalloc parameters swapped

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>
This commit is contained in:
Axel Lin 2012-02-11 09:00:48 +08:00 коммит произвёл Greg Kroah-Hartman
Родитель 5f01f7f301
Коммит 09f993e684
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;