mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
usb: usb251xb: fix to avoid potential NULL pointer dereference
[ Upstream commit 41f00e6e9e55546390031996b773e7f3c1d95928 ] of_match_device in usb251xb_probe can fail and returns a NULL pointer. The patch avoids a potential NULL pointer dereference in this scenario. Signed-off-by: Aditya Pakki <pakki001@umn.edu> Reviewed-by: Richard Leitner <richard.leitner@skidata.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
This commit is contained in:
parent
5d429f7624
commit
085df4a0ed
@ -530,7 +530,7 @@ static int usb251xb_probe(struct usb251xb *hub)
|
||||
dev);
|
||||
int err;
|
||||
|
||||
if (np) {
|
||||
if (np && of_id) {
|
||||
err = usb251xb_get_ofdata(hub,
|
||||
(struct usb251xb_data *)of_id->data);
|
||||
if (err) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user