From: Suman Anna Date: Sat, 2 Feb 2013 02:30:09 +0000 (-0600) Subject: mailbox: check for NULL nb in mailbox_put X-Git-Tag: next-20130322~15^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6275aa1ae16b73f0391f9be199af1c64845a62b1;p=karo-tx-linux.git mailbox: check for NULL nb in mailbox_put The mailbox_put function must check the notifier block for NULL before trying to unregister it. Signed-off-by: Fernando Guzman Lugo Signed-off-by: Suman Anna --- diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index eaaf87ec9009..c38241a8b44a 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -473,7 +473,8 @@ EXPORT_SYMBOL(mailbox_get); void mailbox_put(struct mailbox *mbox, struct notifier_block *nb) { - blocking_notifier_chain_unregister(&mbox->notifier, nb); + if (nb) + blocking_notifier_chain_unregister(&mbox->notifier, nb); mailbox_fini(mbox); } EXPORT_SYMBOL(mailbox_put);