From patchwork Wed Feb 14 07:15:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10218123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D2333601C2 for ; Wed, 14 Feb 2018 07:15:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9D7128F55 for ; Wed, 14 Feb 2018 07:15:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE2D028F59; Wed, 14 Feb 2018 07:15:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A3FC28F56 for ; Wed, 14 Feb 2018 07:15:52 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 35E3226778C; Wed, 14 Feb 2018 08:15:50 +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 E7E1126778D; Wed, 14 Feb 2018 08:15:48 +0100 (CET) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by alsa0.perex.cz (Postfix) with ESMTP id 58C1A26778B for ; Wed, 14 Feb 2018 08:15:44 +0100 (CET) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1E7BxiS022447; Wed, 14 Feb 2018 07:15:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=+X31fcKrOfCvXLKwzlrsCuJC3BdHCjumeJPawtDI/KE=; b=Ua7jJvrOkg1X5s7PInsexXpDKyvvTzd9wzkTq+RoK0JGfVeEzUps2xHDlxAY6dfrHf8D lyUEcJCVVG3CfILRPV9pgD4b/B15he1zfzAODxNWy2L/7Nu5R06WxfRn35JTtFasmcuY PwYHlrvj2Ep25UQBwK7nZubEKGRczrvkyszHhWEf60ng8/tETJHEU+yVZYgv+sszuNTy ZSYMtUYpuehTe54Kkw/hQaeuor+k2kJ84MywLwxXBdFoo0Cmx1dGK1m8cpmb0zYKV2Ng yFjBUus1YgnZM3g3ZZLN1rIrvA3uqhvGcgs04+b0WJXoaTAZ4K/bHOWH9xXntYeokOeT fw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2g4fpfr6xv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Feb 2018 07:15:43 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1E7Ffp9028204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 14 Feb 2018 07:15:41 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w1E7Fdog027406; Wed, 14 Feb 2018 07:15:39 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 13 Feb 2018 23:15:39 -0800 Date: Wed, 14 Feb 2018 10:15:31 +0300 From: Dan Carpenter To: Katsuhiro Suzuki Message-ID: <20180214071531.GB26677@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.3 (2018-01-21) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8804 signatures=668670 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=627 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802140085 Cc: alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, Takashi Iwai , Liam Girdwood , Masahiro Yamada , Mark Brown Subject: [alsa-devel] [PATCH] ASoC: uniphier: fix an error code in uniphier_aio_comprdma_new() 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 The dma_mapping_error() returns true or false, but we want to return -ENOMEM if there was an error. Fixes: e98131222ff9 ("ASoC: uniphier: add support for UniPhier AIO compress audio") Signed-off-by: Dan Carpenter diff --git a/sound/soc/uniphier/aio-compress.c b/sound/soc/uniphier/aio-compress.c index 7f7abe3ae99d..4751c8bdabec 100644 --- a/sound/soc/uniphier/aio-compress.c +++ b/sound/soc/uniphier/aio-compress.c @@ -54,12 +54,11 @@ static int uniphier_aio_comprdma_new(struct snd_soc_pcm_runtime *rtd) dma_dir = DMA_TO_DEVICE; sub->compr_addr = dma_map_single(dev, sub->compr_area, size, dma_dir); - ret = dma_mapping_error(dev, sub->compr_addr); - if (ret) { + if (dma_mapping_error(dev, sub->compr_addr)) { kfree(sub->compr_area); sub->compr_area = NULL; - return ret; + return -ENOMEM; } sub->compr_bytes = size;