]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mailbox: check for NULL nb in mailbox_put
authorSuman Anna <s-anna@ti.com>
Sat, 2 Feb 2013 02:30:09 +0000 (20:30 -0600)
committerSuman Anna <s-anna@ti.com>
Thu, 14 Mar 2013 18:15:13 +0000 (13:15 -0500)
The mailbox_put function must check the notifier block for
NULL before trying to unregister it.

Signed-off-by: Fernando Guzman Lugo <lugo.fernando@gmail.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/mailbox/mailbox.c

index eaaf87ec9009c4b25741843d0e573446170ad572..c38241a8b44adf1c9024a4a11155d982aae712b5 100644 (file)
@@ -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);