提交 91d41c18 编写于 作者: A Aditya Pakki 提交者: Xie XiuQi

usb: usb251xb: fix to avoid potential NULL pointer dereference

[ Upstream commit 41f00e6e ]

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: NAditya Pakki <pakki001@umn.edu>
Reviewed-by: NRichard Leitner <richard.leitner@skidata.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 9a87a320
...@@ -601,7 +601,7 @@ static int usb251xb_probe(struct usb251xb *hub) ...@@ -601,7 +601,7 @@ static int usb251xb_probe(struct usb251xb *hub)
dev); dev);
int err; int err;
if (np) { if (np && of_id) {
err = usb251xb_get_ofdata(hub, err = usb251xb_get_ofdata(hub,
(struct usb251xb_data *)of_id->data); (struct usb251xb_data *)of_id->data);
if (err) { if (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册