From patchwork Fri Jun 26 10:34:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maninder Singh X-Patchwork-Id: 6680211 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 42277C05AC for ; Fri, 26 Jun 2015 10:39:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 62057206B1 for ; Fri, 26 Jun 2015 10:39:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8DEF120697 for ; Fri, 26 Jun 2015 10:39:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z8R10-0006wY-Sy; Fri, 26 Jun 2015 10:37:46 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z8R0v-0006kp-Mt for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2015 10:37:42 +0000 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NQJ025YXS65NT90@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2015 19:37:17 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.126]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 53.FA.29324.C5B2D855; Fri, 26 Jun 2015 19:37:17 +0900 (KST) X-AuditID: cbfee68d-f79106d00000728c-22-558d2b5c63fb Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id EC.3E.25346.C5B2D855; Fri, 26 Jun 2015 19:37:16 +0900 (KST) Received: from localhost.localdomain ([107.108.92.210]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NQJ00H5TS47ZG80@mmp1.samsung.com>; Fri, 26 Jun 2015 19:37:16 +0900 (KST) From: Maninder Singh To: nicolas.ferre@atmel.com, vinod.koul@intel.com, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org Subject: [PATCH 1/1] dmaengine: Use Pointer xt after NULL check. Date: Fri, 26 Jun 2015 16:04:48 +0530 Message-id: <1435314888-20491-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsWyRsSkTjdWuzfU4GwXi8X0qRcYLVZP/ctq senxNVaLw/PbWCy+XW5mt7j3ZiuTxcu+/SwO7B4Lfm1l8Vi85yWTx+Yl9R59W1YxenzeJBfA GsVlk5Kak1mWWqRvl8CVsf/5apaCJxwVR7ZvYmtg7GHvYuTkkBAwkXh66C8bhC0mceHeeiCb i0NIYCmjxN6Lz5lhiq7sOA2VWMQo0XjiGwuE85NRYtmPfSwgVWwCehKrdu0BS4gI9DFKHLlx D2gHBwezgJPE9K96IDXCAg4SW1atB6tnEVCVWHzzFpjNK+Au8frMRCaQcgkBBYk5k2xAxkgI /GaTuH9zHytEvYDEt8mHWCBqZCU2HYA6TlLi4IobLBMYBRcwMqxiFE0tSC4oTkovMtQrTswt Ls1L10vOz93ECAza0/+e9e5gvH3A+hCjAAejEg/vCs3eUCHWxLLiytxDjKZAGyYyS4km5wNj I68k3tDYzMjC1MTU2Mjc0kxJnFdR6mewkEB6YklqdmpqQWpRfFFpTm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gAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150626_033741_887962_43627644 X-CRM114-Status: UNSURE ( 9.23 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -8.3 (--------) Cc: Maninder Singh , pankaj.m@samsung.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Removing static analysis error:- Possible null pointer dereference: xt Because currently xt is dereferenced before NULL check, Thus Use it after NULL Check. Signed-off-by: Maninder Singh Reviewed-by: Vaneet Narang Acked-by: Nicolas Ferre --- drivers/dma/at_hdmac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 59892126..d313acb 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -659,14 +659,14 @@ atc_prep_dma_interleaved(struct dma_chan *chan, size_t len = 0; int i; + if (unlikely(!xt || xt->numf != 1 || !xt->frame_size)) + return NULL; + dev_info(chan2dev(chan), "%s: src=0x%08x, dest=0x%08x, numf=%d, frame_size=%d, flags=0x%lx\n", __func__, xt->src_start, xt->dst_start, xt->numf, xt->frame_size, flags); - if (unlikely(!xt || xt->numf != 1 || !xt->frame_size)) - return NULL; - /* * The controller can only "skip" X bytes every Y bytes, so we * need to make sure we are given a template that fit that