staging:iio:dac: Fix kcalloc parameters swapped
authorAxel Lin <axel.lin@gmail.com>
Sat, 11 Feb 2012 01:00:48 +0000 (09:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2012 04:09:38 +0000 (20:09 -0800)
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>
drivers/staging/iio/dac/ad5360.c
drivers/staging/iio/dac/ad5380.c

index 710b256affcc623d36e41ac76c229cbc809c4db0..cec3693b50a373e305133b7ed5f01fd7629f56e6 100644 (file)
@@ -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;
index eff97ae05c4be37b3356b6c66b1d6b64050a6c10..4c50716fa8015baa48d17453e63d4c4cdab61ef7 100644 (file)
@@ -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;