mailbox: Fix deleteing poll timer
authorLeyFoon Tan <lftan.linux@gmail.com>
Tue, 18 Mar 2014 18:46:39 +0000 (00:16 +0530)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Mon, 12 May 2014 12:27:39 +0000 (13:27 +0100)
Try to delete the timer only if it was init/used.

Signed-off-by: LeyFoon Tan <lftan.linux@gmail.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/mailbox.c

index cdf7d45..d080fc3 100644 (file)
@@ -584,7 +584,8 @@ void mbox_controller_unregister(struct mbox_controller *mbox)
        list_for_each_entry(chan, &con->channels, node)
                mbox_free_channel(chan);
 
-       del_timer_sync(&con->poll);
+       if (mbox->txdone_poll)
+               del_timer_sync(&con->poll);
 
        kfree(con);
 }