mailbox: Fix deleteing poll timer
authorLeyFoon Tan <lftan.linux@gmail.com>
Tue, 18 Mar 2014 18:46:39 +0000 (00:16 +0530)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 2 Jun 2014 09:44:05 +0000 (10:44 +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);
 }