Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: da8xx-fb: add missing regulator_disable() in fb_probe

The error handling code in fb_probe misses regulator_disable if
regulator_enable is called successfully. The previous commit only
adds regulator_disable in the .remove(), forgetting the error
handling code in the .probe.

Fix this by adding a new error label to call regulator_disable.

Fixes: 611097d5daea("fbdev: da8xx: add support for a regulator")
Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Dongliang Mu and committed by
Helge Deller
cd53860e ff61582e

+5 -2
+5 -2
drivers/video/fbdev/da8xx-fb.c
··· 1431 1431 dev_err(&device->dev, 1432 1432 "GLCD: kmalloc for frame buffer failed\n"); 1433 1433 ret = -EINVAL; 1434 - goto err_release_fb; 1434 + goto err_disable_reg; 1435 1435 } 1436 1436 1437 1437 da8xx_fb_info->screen_base = (char __iomem *) par->vram_virt; ··· 1475 1475 1476 1476 ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0); 1477 1477 if (ret) 1478 - goto err_release_fb; 1478 + goto err_disable_reg; 1479 1479 da8xx_fb_info->cmap.len = par->palette_sz; 1480 1480 1481 1481 /* initialize var_screeninfo */ ··· 1529 1529 err_dealloc_cmap: 1530 1530 fb_dealloc_cmap(&da8xx_fb_info->cmap); 1531 1531 1532 + err_disable_reg: 1533 + if (par->lcd_supply) 1534 + regulator_disable(par->lcd_supply); 1532 1535 err_release_fb: 1533 1536 framebuffer_release(da8xx_fb_info); 1534 1537