Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 068cf29e authored by Dan Carpenter's avatar Dan Carpenter Committed by Jassi Brar
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent e0c6fba4
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -1191,10 +1191,11 @@ static void pdc_shutdown(struct mbox_chan *chan)
{
{
	struct pdc_state *pdcs = chan->con_priv;
	struct pdc_state *pdcs = chan->con_priv;


	if (pdcs)
	if (!pdcs)
		return;

	dev_dbg(&pdcs->pdev->dev,
	dev_dbg(&pdcs->pdev->dev,
		"Shutdown mailbox channel for PDC %u", pdcs->pdc_idx);
		"Shutdown mailbox channel for PDC %u", pdcs->pdc_idx);

	pdc_ring_free(pdcs);
	pdc_ring_free(pdcs);
}
}