From patchwork Wed Oct 19 13:23:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9383991 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 77B03600CA for ; Wed, 19 Oct 2016 13:25:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D595296B8 for ; Wed, 19 Oct 2016 13:25:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E272295D1; Wed, 19 Oct 2016 13:25:55 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B5737295D1 for ; Wed, 19 Oct 2016 13:25:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bwqr5-0000vk-Cv; Wed, 19 Oct 2016 13:24:27 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bwqr1-0000r7-4q for linux-arm-kernel@lists.infradead.org; Wed, 19 Oct 2016 13:24:24 +0000 Received: by mail-pf0-x243.google.com with SMTP id s8so2504865pfj.2 for ; Wed, 19 Oct 2016 06:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rN7eGcADrVkS02FJKlsHrRqo/SxXs8OYEe+80BseNWw=; b=HQlUk3D3lBU/9Sx/ygRXrDdP0Mwv4MDaSZXFg2FJyL1Auedn6D3ddH4+zVp2awruwH qvBQ6OMHiFHBoRGPCnSOgtO1K59XX4F4ukOKCX60/+9sY1E21FfFX0vWNY1LpiRMM9Rd +xFlhSoi1bPBI3eX1b5+bpSquNHJjLOU4ZOhwq/K/6Q3pXQgkZMxut+XPuMsngy+x5zD SsB+PvyF3bcvm6XzncDgcpA7en4qM5Ix7be7dupCnNJnZFFfYMcqdD9usrstCcREAVpx uIQIovkrKvx8dV1Hpo97Y0PiRlXM2tqW+1l7WPnGDYDFkwWS66+g7q+vuPud8eulZ3Ps 0HgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rN7eGcADrVkS02FJKlsHrRqo/SxXs8OYEe+80BseNWw=; b=S8rF47W3Nzljcterq913M1PIXVw+GnFXh0xKgrHlGGwvECLr3D9W84p1IV6NfC8tb0 XR4O6b1RBv5J5OeBt9+FcMhG7LpTGyLFjmu/BAOk5xjZbgRntmaBrH7xMxQrWxUG4rcE OwTe3zkoEWKM298Yj15hpVl+699/EDutVke/cE95YNV1D1AYCvcphAhqcGe/hsSv7quf bjZfL3TinXjCwnnTzX96s7mZpe553bsYXl7Wz/7RuWZHUTd4J8WRrB8xNcw0ifngWY36 2Xs/Jnl5lVp9hj23t1+lUMcLeOgCLso8+fH6qocecpX3caTOAqJhFVQ4ASmbN8avRpqc g19w== X-Gm-Message-State: AA6/9RnDITHSPTJ40ZhHLL3ocOk82ySSVB6ew9Lx0CHEgLqHFP9n733Bx4n75MGLgwwYtQ== X-Received: by 10.98.36.91 with SMTP id r88mr11421900pfj.10.1476883440862; Wed, 19 Oct 2016 06:24:00 -0700 (PDT) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id l85sm64021276pfk.55.2016.10.19.06.23.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Oct 2016 06:24:00 -0700 (PDT) From: Wei Yongjun To: Patrice Chotard , Dan Williams , Vinod Koul Subject: [PATCH -next] dmaengine: st_fdma: Fix the error return code in st_fdma_probe() Date: Wed, 19 Oct 2016 13:23:50 +0000 Message-Id: <1476883430-11970-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161019_062423_305933_8DC8058F X-CRM114-Status: GOOD ( 12.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, Wei Yongjun , kernel@stlinux.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function st_slim_rproc_alloc() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun Acked-by: Peter Griffin --- drivers/dma/st_fdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c index 515e1d4..a66a57b 100644 --- a/drivers/dma/st_fdma.c +++ b/drivers/dma/st_fdma.c @@ -802,7 +802,7 @@ static int st_fdma_probe(struct platform_device *pdev) } fdev->slim_rproc = st_slim_rproc_alloc(pdev, fdev->fw_name); - if (!fdev->slim_rproc) { + if (IS_ERR(fdev->slim_rproc)) { ret = PTR_ERR(fdev->slim_rproc); dev_err(&pdev->dev, "slim_rproc_alloc failed (%d)\n", ret); goto err;