Re: [PATCH] add chan->cl check in mbox_chan_received_data()
From: Jassi Brar
Date: Tue Dec 15 2020 - 16:22:11 EST
On Tue, Dec 15, 2020 at 2:48 AM Haidong Yao <yaohaidong369@xxxxxxxxx> wrote:
> --- a/drivers/mailbox/mailbox.c
> +++ b/drivers/mailbox/mailbox.c
> @@ -152,7 +152,7 @@ static enum hrtimer_restart txdone_hrtimer(struct hrtimer *hrtimer)
> void mbox_chan_received_data(struct mbox_chan *chan, void *mssg)
> {
> /* No buffering the received data */
> - if (chan->cl->rx_callback)
> + if (chan->cl && chan->cl->rx_callback)
> chan->cl->rx_callback(chan->cl, mssg);
> }
The proper fix is in the controller driver. Which should stop tx/rx
when the channel is freed.
thnx.