From patchwork Mon Apr 13 06:00:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6205061 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 630289F1C4 for ; Mon, 13 Apr 2015 06:01:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A245C2026F for ; Mon, 13 Apr 2015 06:01:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D9B7A200CF for ; Mon, 13 Apr 2015 06:01:08 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 88D75261703; Mon, 13 Apr 2015 08:01:07 +0200 (CEST) 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 E1C8A261629; Mon, 13 Apr 2015 08:00:59 +0200 (CEST) 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 570F426163C; Mon, 13 Apr 2015 08:00:58 +0200 (CEST) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 982D5261609 for ; Mon, 13 Apr 2015 08:00:50 +0200 (CEST) Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 13 Apr 2015 15:00:48 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 3EB6E41402; Mon, 13 Apr 2015 15:00:48 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 1CB6B8002E; Mon, 13 Apr 2015 15:00:48 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 14A658002D; Mon, 13 Apr 2015 15:00:48 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id RAE03520; Mon, 13 Apr 2015 15:00:48 +0900 X-IronPort-AV: E=Sophos;i="5.11,568,1422889200"; d="scan'208";a="183906362" Received: from mail-sg1lp0092.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.92]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 13 Apr 2015 15:00:47 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.132) by HKXPR06MB310.apcprd06.prod.outlook.com (10.141.135.152) with Microsoft SMTP Server (TLS) id 15.1.136.25; Mon, 13 Apr 2015 06:00:45 +0000 Message-ID: <87oams7elr.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Mon, 13 Apr 2015 06:00:45 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: TY1PR0201CA0023.apcprd02.prod.outlook.com (25.164.90.161) To HKXPR06MB310.apcprd06.prod.outlook.com (10.141.135.152) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB310; X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(36756003)(4001350100001)(40100003)(92566002)(23726002)(86362001)(87976001)(77096005)(33646002)(122386002)(19580395003)(110136001)(19580405001)(42186005)(53416004)(66066001)(83506001)(46102003)(46406003)(54356999)(50466002)(50986999)(229853001)(62966003)(77156002); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB310; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002010)(5005006); SRVR:HKXPR06MB310; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB310; X-Forefront-PRVS: 0545EFAC9A X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2015 06:00:45.7126 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB310 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: rsnd: set dmaen->chan = NULL when error case 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 rsnd_dmaen_quit() is assuming dmaen->chan is NULL if it failed to get DMAEngine channel. but, current dmaen->chan might have error value when error case (this driver is checking it by IS_ERR_OR_NULL()) This patch makes sure dmaen->chan is NULL when error case. Otherwise, it will contact to unknown address in rsnd_dmaen_quit() Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/dma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c index ac3756f..144308f 100644 --- a/sound/soc/sh/rcar/dma.c +++ b/sound/soc/sh/rcar/dma.c @@ -156,6 +156,7 @@ static int rsnd_dmaen_init(struct rsnd_priv *priv, struct rsnd_dma *dma, int id, (void *)id); } if (IS_ERR_OR_NULL(dmaen->chan)) { + dmaen->chan = NULL; dev_err(dev, "can't get dma channel\n"); goto rsnd_dma_channel_err; }