mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 12:46:14 +02:00
usb: musb-new: Null check before dereference
A null check for the variable 'data' was introduced before dereferencing it for set_phy_power but other uses were not so protected. Add the null check for other dereferences of 'data'. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
This commit is contained in:
parent
adcec085e0
commit
6ea91bf805
@ -402,7 +402,7 @@ static int am35x_musb_init(struct musb *musb)
|
||||
#endif
|
||||
|
||||
/* Reset the musb */
|
||||
if (data->reset)
|
||||
if (data && data->reset)
|
||||
data->reset(data->dev);
|
||||
|
||||
/* Reset the controller */
|
||||
@ -417,7 +417,7 @@ static int am35x_musb_init(struct musb *musb)
|
||||
musb->isr = am35x_musb_interrupt;
|
||||
|
||||
/* clear level interrupt */
|
||||
if (data->clear_irq)
|
||||
if (data && data->clear_irq)
|
||||
data->clear_irq(data->dev);
|
||||
|
||||
return 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user