Skip to contentSkip to conversation

universal_c210: check the NULL pointer when get the PMIC

PATCH Superseded Minkyu Kang 2 participants 4 messages Dec 10, 2012 – Dec 11, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 universal_c210: check the NULL pointer when get the PMIC

PMIC 2.0 require to test return pointer from pmic_get()

Cc Lukasz Majewski <[email protected]>
Cc Wolfgang Denk <[email protected]>
---
 board/samsung/universal_c210/universal.c |    6 ++++++
 1 file changed, 6 insertions(+)
board/samsung/universal_c210/universal.c +6 -0
index 4869798..ae24469 100644
@@ -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;
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/1 universal_c210: check the NULL pointer when get the PMIC

PMIC 2.0 require to test return pointer from pmic_get()

Cc Lukasz Majewski <[email protected]>
Cc Wolfgang Denk <[email protected]>

---
Changes in V2:
- Since functions are void type, remove the return value.

 board/samsung/universal_c210/universal.c |    6 ++++++
 1 file changed, 6 insertions(+)
board/samsung/universal_c210/universal.c +6 -0
index 4869798..e742707 100644
@@ -343,6 +343,9 @@ static void init_pmic_lcd(void)
 
 	struct pmic *p = pmic_get("MAX8998_PMIC");
 
+	if (!p)
+		return;
+
 	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;
+
 	if (pmic_probe(p))
 		return;
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 1/1 universal_c210: check the NULL pointer when get the PMIC

Hi Minkyu,

Quoted 27 lines

PMIC 2.0 require to test return pointer from pmic_get()

Cc Lukasz Majewski <[email protected]>
Cc Wolfgang Denk <[email protected]>

---
Changes in V2:
- Since functions are void type, remove the return value.

 board/samsung/universal_c210/universal.c |    6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/board/samsung/universal_c210/universal.c index 4869798..e742707 100644 --- a/board/samsung/universal_c210/universal.c +++ b/board/samsung/universal_c210/universal.c

board/samsung/universal_c210/universal.c +3 -0
@@ -343,6 +343,9 @@ static void init_pmic_lcd(void)
 
 	struct pmic *p = pmic_get("MAX8998_PMIC");
 
+	if (!p)
+		return;
+
 	if (pmic_probe(p))
 		return;
 

board/samsung/universal_c210/universal.c static void lcd_power_on(void) · line 445

Quoted 9 lines
board/samsung/universal_c210/universal.c +3 -0
@@ -434,6 +437,9 @@ static void lcd_power_on(void)
 {
 	struct pmic *p = pmic_get("MAX8998_PMIC");
 
+	if (!p)
+		return;
+
 	if (pmic_probe(p))
 		return;
 
Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group
#3 lore raw

PATCH v2 1/1 universal_c210: check the NULL pointer when get the PMIC

Quoted 14 lines · Lukasz Majewski

Hi Minkyu,

Quoted 12 lines

PMIC 2.0 require to test return pointer from pmic_get()

Cc Lukasz Majewski <[email protected]>
Cc Wolfgang Denk <[email protected]>

---
Changes in V2:
- Since functions are void type, remove the return value.

 board/samsung/universal_c210/universal.c |    6 ++++++
 1 file changed, 6 insertions(+)

applied to u-boot-samsung/resolve.

Thanks.
Minkyu Kang.