diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-08-04 05:30:31 (GMT) |
---|---|---|
committer | Jassi Brar <jaswinder.singh@linaro.org> | 2016-08-29 13:11:15 (GMT) |
commit | 068cf29eca4ef25556496635b978143b170b862c (patch) | |
tree | 9c188a417de5fe9051924fdd13f525865811736a /drivers | |
parent | e0c6fba45ab730afc22fa01ac1c42459893252ec (diff) | |
download | linux-068cf29eca4ef25556496635b978143b170b862c.tar.xz |
mailbox: bcm-pdc: potential NULL dereference in pdc_shutdown()
We can't pass NULL pointers to pdc_ring_free() so I moved the check for
NULL.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mailbox/bcm-pdc-mailbox.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mailbox/bcm-pdc-mailbox.c b/drivers/mailbox/bcm-pdc-mailbox.c index cbe0c1e..c56d4d0 100644 --- a/drivers/mailbox/bcm-pdc-mailbox.c +++ b/drivers/mailbox/bcm-pdc-mailbox.c @@ -1191,10 +1191,11 @@ static void pdc_shutdown(struct mbox_chan *chan) { struct pdc_state *pdcs = chan->con_priv; - if (pdcs) - dev_dbg(&pdcs->pdev->dev, - "Shutdown mailbox channel for PDC %u", pdcs->pdc_idx); + if (!pdcs) + return; + dev_dbg(&pdcs->pdev->dev, + "Shutdown mailbox channel for PDC %u", pdcs->pdc_idx); pdc_ring_free(pdcs); } |