提交 ddf58468 编写于 作者: P Paul Zimmerman 提交者: Greg Kroah-Hartman

staging: dwc2: fix potential null pointer access

We were testing hsotg pointer for null after we had already
dereferenced it
Reported-by: NFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: NPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a9b3ea3d
......@@ -217,18 +217,18 @@ static void dwc2_update_frame_list(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
struct dwc2_host_chan *chan;
u16 i, j, inc;
if (!qh->channel) {
dev_err(hsotg->dev, "qh->channel = %p", qh->channel);
if (!hsotg) {
pr_err("hsotg = %p", hsotg);
return;
}
if (!hsotg) {
dev_err(hsotg->dev, "------hsotg = %p", hsotg);
if (!qh->channel) {
dev_err(hsotg->dev, "qh->channel = %p", qh->channel);
return;
}
if (!hsotg->frame_list) {
dev_err(hsotg->dev, "-------hsotg->frame_list = %p",
dev_err(hsotg->dev, "hsotg->frame_list = %p",
hsotg->frame_list);
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册