diff options
| author | Andrew Goodbody <[email protected]> | 2025-09-30 16:52:22 +0100 |
|---|---|---|
| committer | Marek Vasut <[email protected]> | 2025-10-28 16:35:05 +0100 |
| commit | 6ea91bf8055b18b24828c449e33572ca9a9832eb (patch) | |
| tree | 3cff61967bacc7a260a4fc69805a4395ccc420f4 | |
| parent | adcec085e0dd3e399e6ee5ab5a7dd0e3cd192316 (diff) | |
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 <[email protected]>
| -rw-r--r-- | drivers/usb/musb-new/am35x.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/musb-new/am35x.c b/drivers/usb/musb-new/am35x.c index 42bc816e4f1..ca4d798642e 100644 --- a/drivers/usb/musb-new/am35x.c +++ b/drivers/usb/musb-new/am35x.c @@ -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; |
