From patchwork Sat Jun 8 01:57:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 2692001 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 D8B8640077 for ; Sat, 8 Jun 2013 02:03:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751309Ab3FHCDP (ORCPT ); Fri, 7 Jun 2013 22:03:15 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:38257 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751005Ab3FHCDO (ORCPT ); Fri, 7 Jun 2013 22:03:14 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5822kv7016862; Fri, 7 Jun 2013 21:02:46 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r5822kan026656; Fri, 7 Jun 2013 21:02:46 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Fri, 7 Jun 2013 21:02:46 -0500 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 r5822krF026797; Fri, 7 Jun 2013 21:02:46 -0500 From: Suman Anna To: Tony Lindgren CC: Ohad Ben-Cohen , Omar Ramirez Luna , Jassi Brar , Loic Pallardy , , , Suman Anna , Fernando Guzman Lugo Subject: [PATCH 2/7] omap: mailbox: check for NULL nb in mailbox_put Date: Fri, 7 Jun 2013 20:57:44 -0500 Message-ID: <1370656664-41250-1-git-send-email-s-anna@ti.com> X-Mailer: git-send-email 1.8.2 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 --- arch/arm/plat-omap/mailbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index 42377ef..5fb4027 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c @@ -356,7 +356,8 @@ EXPORT_SYMBOL(omap_mbox_get); void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb) { - blocking_notifier_chain_unregister(&mbox->notifier, nb); + if (nb) + blocking_notifier_chain_unregister(&mbox->notifier, nb); omap_mbox_fini(mbox); } EXPORT_SYMBOL(omap_mbox_put);