]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fb: hx8357: Fix inverted parameters for kcalloc
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 20 Feb 2013 02:15:28 +0000 (13:15 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:53:16 +0000 (16:53 +1100)
The element size and the number of elements was inverted in the kcalloc
call.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/video/backlight/hx8357.c

index 071525c4ab5e62a21b3bd24b91a69927dd4a9208..2691fd6ad3d961df9d2a12ef51b709a740ab1d41 100644 (file)
@@ -94,7 +94,7 @@ static int hx8357_spi_write_then_read(struct lcd_device *lcdev,
        if (txlen) {
                int i;
 
-               local_txbuf = kcalloc(sizeof(*local_txbuf), txlen, GFP_KERNEL);
+               local_txbuf = kcalloc(txlen, sizeof(*local_txbuf), GFP_KERNEL);
 
                if (!local_txbuf) {
                        dev_err(&lcdev->dev, "Couldn't allocate data buffer.\n");