From patchwork Mon Dec 10 13:50:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot] universal_c210: check the NULL pointer when get the PMIC From: Minkyu Kang X-Patchwork-Id: 204879 Message-Id: <50C5E8B5.3080805@samsung.com> To: "u-boot@lists.denx.de" Date: Mon, 10 Dec 2012 22:50:45 +0900 PMIC 2.0 require to test return pointer from pmic_get() Signed-off-by: Minkyu Kang Cc: Lukasz Majewski Cc: Wolfgang Denk --- board/samsung/universal_c210/universal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c index 4869798..ae24469 100644 --- a/board/samsung/universal_c210/universal.c +++ b/board/samsung/universal_c210/universal.c @@ -343,6 +343,9 @@ static void init_pmic_lcd(void) struct pmic *p = pmic_get("MAX8998_PMIC"); + if (!p) + return -ENODEV; + if (pmic_probe(p)) return; @@ -434,6 +437,9 @@ static void lcd_power_on(void) { struct pmic *p = pmic_get("MAX8998_PMIC"); + if (!p) + return -ENODEV; + if (pmic_probe(p)) return;