Thread (6 messages) 6 messages, 1 author, 2013-02-13

[PATCH 2/5] fb: hx8357: Fix inverted parameters for kcalloc

From: Maxime Ripard <hidden>
Date: 2013-02-13 10:41:12
Also in: lkml
Subsystem: backlight class/subsystem, framebuffer layer, the rest · Maintainers: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Linus Torvalds

The element size and the number of elements was inverted in the kcalloc
call.

Signed-off-by: Maxime Ripard <redacted>
---
 drivers/video/backlight/hx8357.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c
index 071525c..2691fd6 100644
--- a/drivers/video/backlight/hx8357.c
+++ b/drivers/video/backlight/hx8357.c
@@ -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");
-- 
1.7.10.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help