From 6275aa1ae16b73f0391f9be199af1c64845a62b1 Mon Sep 17 00:00:00 2001 From: Suman Anna Date: Fri, 1 Feb 2013 20:30:09 -0600 Subject: [PATCH] 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 --- drivers/mailbox/mailbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.39.5