Hi Wolfgang,

> Dear Minkyu Kang,
> 
> In message <50c58623.3090...@samsung.com> you wrote:
> ...
> > @@ -337,7 +341,7 @@ static void init_pmic_lcd(void)
> >     unsigned char val;
> >     int ret = 0;
> >  
> > -   struct pmic *p = get_pmic();
> > +   struct pmic *p = pmic_get("MAX8998_PMIC");
> >  
> >     if (pmic_probe(p))
> >             return;
> > @@ -428,7 +432,7 @@ static void reset_lcd(void)
> >  
> >  static void lcd_power_on(void)
> >  {
> > -   struct pmic *p = get_pmic();
> > +   struct pmic *p = pmic_get("MAX8998_PMIC");
> >  
> >     if (pmic_probe(p))
> >             return;
> 
> This is unrelated to your patch - but what if pmic_get() returns NULL?
> 
> pmic_probe() will crashif you pass it a NULL pointer...

The PMIC 2.0 uses malloc to allocate pmic structure.

The fix, which has been proposed would work for old pmic.

In the new one PMIC 2.0, we require to test return pointer from
pmic_get() (similar to all malloc allocations):

struct pmic *p = pmic_get("MAX8998_PMIC");
if (!p)
        return -ENODEV;


> 
> Best regards,
> 
> Wolfgang Denk
> 



-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to