From patchwork Thu Nov 27 08:06:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5393051 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5B314C11AC for ; Thu, 27 Nov 2014 08:11:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 934342012D for ; Thu, 27 Nov 2014 08:11:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 692C12010B for ; Thu, 27 Nov 2014 08:11:49 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5BB86266485; Thu, 27 Nov 2014 09:11:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 4A0EA266012; Thu, 27 Nov 2014 09:08:27 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C5726266005; Thu, 27 Nov 2014 09:08:23 +0100 (CET) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 51CF3265B9E for ; Thu, 27 Nov 2014 09:06:28 +0100 (CET) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 27 Nov 2014 17:06:26 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id F08334A270; Thu, 27 Nov 2014 17:06:26 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id EF323480A3; Thu, 27 Nov 2014 17:06:26 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id EDAE9480A5; Thu, 27 Nov 2014 17:06:26 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id TAB04774; Thu, 27 Nov 2014 17:06:26 +0900 X-IronPort-AV: E=Sophos;i="5.07,467,1413212400"; d="scan'208";a="175655451" Received: from mail-sg1lp0092.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.92]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 27 Nov 2014 17:06:26 +0900 Received: from remon.renesas.com (211.11.155.132) by SINPR06MB170.apcprd06.prod.outlook.com (10.242.57.16) with Microsoft SMTP Server (TLS) id 15.1.26.15; Thu, 27 Nov 2014 08:06:25 +0000 Message-ID: <87r3wp83ud.wl%kuninori.morimoto.gx@renesas.com> To: Mark Brown In-Reply-To: <877fyh9ilx.wl%kuninori.morimoto.gx@renesas.com> References: <877fyh9ilx.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Date: Thu, 27 Nov 2014 08:06:25 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: SIXPR06CA0055.apcprd06.prod.outlook.com (25.160.171.173) To SINPR06MB170.apcprd06.prod.outlook.com (10.242.57.16) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB170; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB170; X-Forefront-PRVS: 040866B734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(47776003)(20776003)(95666004)(105586002)(81156004)(33646002)(66066001)(106356001)(4396001)(64706001)(76176999)(46406003)(62966003)(77156002)(77096003)(83506001)(54356999)(21056001)(229853001)(107046002)(50986999)(40100003)(31966008)(122386002)(46102003)(53416004)(42186005)(120916001)(23726002)(99396003)(110136001)(19580405001)(102836001)(19580395003)(50466002)(86362001)(92726001)(92566001)(97736003)(69596002)(101416001)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:SINPR06MB170; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB170; X-OriginatorOrg: renesas.com Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 11/20] ASoC: rsnd: tidyup rsnd_io_to_runtime() macro X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Avoid NULL pointer access Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/rsnd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 133ba1f..5826c8a 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -303,7 +303,8 @@ struct rsnd_dai *rsnd_dai_get(struct rsnd_priv *priv, int id); int rsnd_dai_is_play(struct rsnd_dai *rdai, struct rsnd_dai_stream *io); int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai); #define rsnd_dai_get_platform_info(rdai) ((rdai)->info) -#define rsnd_io_to_runtime(io) ((io)->substream->runtime) +#define rsnd_io_to_runtime(io) ((io)->substream ? \ + (io)->substream->runtime : NULL) void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int cnt); int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional);