Skip to content

Commit

Permalink
mailbox: bcm-pdc: potential NULL dereference in pdc_shutdown()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Jassi Brar committed Aug 29, 2016
1 parent e0c6fba commit 068cf29
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/mailbox/bcm-pdc-mailbox.c
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 068cf29

Please sign in to comment.