diff options
author | Paul Zimmerman <Paul.Zimmerman@synopsys.com> | 2013-04-22 21:00:16 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-23 17:37:55 (GMT) |
commit | ddf58468e0e787b739a623594f52f9f43a188037 (patch) | |
tree | dea0c37e2d271eded00ab7696cf2852a962c4688 /drivers/staging | |
parent | a9b3ea3dbbb54f9160465f6f1086f877e958fdcc (diff) | |
download | linux-fsl-qoriq-ddf58468e0e787b739a623594f52f9f43a188037.tar.xz |
staging: dwc2: fix potential null pointer access
We were testing hsotg pointer for null after we had already
dereferenced it
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/dwc2/hcd_ddma.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/dwc2/hcd_ddma.c b/drivers/staging/dwc2/hcd_ddma.c index ab88f50..d2180b2 100644 --- a/drivers/staging/dwc2/hcd_ddma.c +++ b/drivers/staging/dwc2/hcd_ddma.c @@ -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; } |