mailbox: Fix deleteing poll timer
authorLeyFoon Tan <lftan.linux@gmail.com>
Thu, 12 Jun 2014 17:02:22 +0000 (22:32 +0530)
committerMark Brown <broonie@linaro.org>
Fri, 13 Jun 2014 20:50:24 +0000 (21:50 +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>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/mailbox/mailbox.c

index 9d356ba77edf0a4a2a818686de2b666e468109c0..e1fc6aaeb87c1045db18e499b4457fe4cefbb92a 100644 (file)
@@ -480,7 +480,8 @@ void mbox_controller_unregister(struct mbox_controller *mbox)
        for (i = 0; i < mbox->num_chans; i++)
                mbox_free_channel(&mbox->chans[i]);
 
-       del_timer_sync(&mbox->poll);
+       if (mbox->txdone_poll)
+               del_timer_sync(&mbox->poll);
 
        mutex_unlock(&con_mutex);
 }