Skip to content

Commit ba23645

Browse files
Yang YingliangThomas Zimmermann
Yang Yingliang
authored and
Thomas Zimmermann
committed
video: fbdev: atmel_lcdfb: fix return error code in atmel_lcdfb_of_init()
If devm_kzalloc() failed after the first time, atmel_lcdfb_of_init() can't return -ENOMEM, fix this by putting the error code in loop. Fixes: b985172 ("video: atmel_lcdfb: add device tree suport") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e9d2871 commit ba23645

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/video/fbdev/atmel_lcdfb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,8 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
987987
}
988988

989989
INIT_LIST_HEAD(&pdata->pwr_gpios);
990-
ret = -ENOMEM;
991990
for (i = 0; i < gpiod_count(dev, "atmel,power-control"); i++) {
991+
ret = -ENOMEM;
992992
gpiod = devm_gpiod_get_index(dev, "atmel,power-control",
993993
i, GPIOD_ASIS);
994994
if (IS_ERR(gpiod))

0 commit comments

Comments
 (0)