From: Axel Lin Date: Sat, 11 Feb 2012 01:00:48 +0000 (+0800) Subject: staging:iio:dac: Fix kcalloc parameters swapped X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=09f993e6844a0cacec2ccff72f04c4fc436a2358;p=openwrt%2Fstaging%2Fblogic.git 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 Acked-by: Lars-Peter Clausen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/dac/ad5360.c b/drivers/staging/iio/dac/ad5360.c index 710b256affcc..cec3693b50a3 100644 --- a/drivers/staging/iio/dac/ad5360.c +++ b/drivers/staging/iio/dac/ad5360.c @@ -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; diff --git a/drivers/staging/iio/dac/ad5380.c b/drivers/staging/iio/dac/ad5380.c index eff97ae05c4b..4c50716fa801 100644 --- a/drivers/staging/iio/dac/ad5380.c +++ b/drivers/staging/iio/dac/ad5380.c @@ -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;