From patchwork Tue Feb 12 04:57:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 2127211 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7F08E3FD4F for ; Tue, 12 Feb 2013 05:06:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933003Ab3BLFDc (ORCPT ); Tue, 12 Feb 2013 00:03:32 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:34510 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932936Ab3BLFDa (ORCPT ); Tue, 12 Feb 2013 00:03:30 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r1C52MEx027862; Mon, 11 Feb 2013 23:02:22 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r1C52MAP012924; Mon, 11 Feb 2013 23:02:22 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Mon, 11 Feb 2013 23:02:21 -0600 Received: from localhost (irmo.am.dhcp.ti.com [128.247.74.241]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r1C52MsB009644; Mon, 11 Feb 2013 23:02:22 -0600 From: Suman Anna To: Greg Kroah-Hartman CC: Linus Walleij , Russell King , Tony Lindgren , Arnd Bergmann , Ohad Ben-Cohen , Paul Walmsley , Benoit Cousson , Loic Pallardy , Omar Ramirez Luna , , , , Mark Brown , Janusz Krzysztofik , Dom Cobley , Wim Van Sebroeck , Felipe Contreras , Tejun Heo , Omar Ramirez Luna , Suman Anna , Fernando Guzman Lugo Subject: [PATCH v2 12/13] mailbox: check for NULL nb in mailbox_put Date: Mon, 11 Feb 2013 22:57:11 -0600 Message-ID: <1360645032-9668-13-git-send-email-s-anna@ti.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1360645032-9668-1-git-send-email-s-anna@ti.com> References: <1360645032-9668-1-git-send-email-s-anna@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 eaaf87e..c38241a 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);