From patchwork Mon Jul 23 15:02:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 10540479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0DF83157A for ; Mon, 23 Jul 2018 15:03:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFCBD204FB for ; Mon, 23 Jul 2018 15:03:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E365827F97; Mon, 23 Jul 2018 15:03:22 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7F47B204FB for ; Mon, 23 Jul 2018 15:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CppuC00g1l4jayz1xOHmwdFQdoCACedqAWaGJlXYdK0=; b=IcJPdTOQEBXODA y6C+pfY/Z7hWMW/FNHXiY3Q9pqxOF6RqyN7LXnNpSQnhMNVX5f6Psvuu/s4UfVDKc/O7lLV63Kf2t N19Bgdaahfqj12/k80oTC8pgeTQNHrgXGG0CwPqn7FLAnDmnw1UsX3u2gWxvbLdRVk6pJbVJnEk+W PCUg8qaHynKDNBuVqDnzC5waZE7UlZZffCGWkgxWzw/ToUXaR9onuT29vgG0SloogDtJyWwG0PyxC lYvAPxl9i0Skzptbb7grvXoC/ZeYXn6sgxddM+z9kkwrh8r/J0c4ecrGCMt5UYGCbho3HOxK81tRB Bxd+Exw8iXTG4Qe64bRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhcMl-0007ys-R1; Mon, 23 Jul 2018 15:03:15 +0000 Received: from mail-cys01nam02on060a.outbound.protection.outlook.com ([2a01:111:f400:fe45::60a] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhcMF-0007MK-Sj for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2018 15:02:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g19W8PQ68DIBTNKR/Ck3+nnZEpSZ+O0mEgpiFVptDO0=; b=nd9fNPuw7+dnzEZvwKh137Qw6ityNLj8oRggcHS5EF1d9Z4AuNadvLuyb6Lhww5tuOQRWMIsqmFYp2T6oDp59tmUdqb6uLI8rZDUpIWcA8KobYwqWGY2m0NXozys1pOiqkRvanXXqVO3jYczSJ8z5xM/kOxr3F/YNn2tF0ZCPq8= Received: from MWHPR0201CA0103.namprd02.prod.outlook.com (2603:10b6:301:75::44) by SN1PR02MB1631.namprd02.prod.outlook.com (2a01:111:e400:519f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Mon, 23 Jul 2018 15:02:28 +0000 Received: from BL2NAM02FT042.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::205) by MWHPR0201CA0103.outlook.office365.com (2603:10b6:301:75::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.973.20 via Frontend Transport; Mon, 23 Jul 2018 15:02:27 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT042.mail.protection.outlook.com (10.152.76.193) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.995.12 via Frontend Transport; Mon, 23 Jul 2018 15:02:26 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1fhcLy-0001B9-9e; Mon, 23 Jul 2018 08:02:26 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1fhcLt-0008VL-67; Mon, 23 Jul 2018 08:02:21 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w6NF2IEc013273; Mon, 23 Jul 2018 08:02:18 -0700 Received: from [172.23.64.106] (helo=xhdvnc125.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fhcLq-0008UV-CO; Mon, 23 Jul 2018 08:02:18 -0700 Received: by xhdvnc125.xilinx.com (Postfix, from userid 16987) id 82E01121473; Mon, 23 Jul 2018 20:32:17 +0530 (IST) From: Manish Narani To: , , , , , , Subject: [PATCH v2 1/4] iio: adc: xilinx: Check for return values in clk related functions Date: Mon, 23 Jul 2018 20:32:00 +0530 Message-ID: <1532358123-23485-2-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1532358123-23485-1-git-send-email-manish.narani@xilinx.com> References: <1532358123-23485-1-git-send-email-manish.narani@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(2980300002)(438002)(199004)(189003)(106466001)(2616005)(486006)(16586007)(476003)(42186006)(4326008)(103686004)(11346002)(106002)(316002)(5660300001)(48376002)(14444005)(63266004)(81156014)(8936002)(44832011)(51416003)(81166006)(6266002)(54906003)(52956003)(36756003)(2906002)(186003)(356003)(90966002)(305945005)(47776003)(426003)(478600001)(2201001)(36386004)(446003)(50226002)(76176011)(26005)(72206003)(50466002)(110136005)(8676002)(126002)(6666003)(336012)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB1631; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT042; 1:nkoAttzkloz9ixfib3sypRo0Y2GlDHhMtxAZCw0pp/e772ukG9kHiMR/DOjp94jULki/ibQyu+7LsO3UHHoBPakjFbJ1fnn5m6kyYU6nlIXrBTN/cijvRAMj7EfiIods MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f803ba1-93c3-4ea3-931d-08d5f0ad4dfd X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060); SRVR:SN1PR02MB1631; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1631; 3:DztnGpKVakLq2x59SRKtFlZVK6mf+SizZ0rCZQgSBGe6fMdOp/5inCtLqdpE8L3ATroGV5PtKvr3rWWFjkWfqWfEcArhOFHOHPyITzHVzfk2otSfY7UaY7Ex6k5gSS6/A9+VJpCK4dIEM6nvyTQ3aUPBIYcgbbeMtXLWB275PcMjEEeO17NFUDDFh0K6hnXGLEyFX8TMDuDMRgcO8OrBCpZnElhGIfPYLRiDsYC+OcT9S45ijlm1LJQwFF/CQCHvdQP5kxDn+jaa3/B/19egwk9aI54RnPDSYkTPn9rcPg9pbj2JRmaiZ/8A8fR6iuDVNVDyYeF2vTmn+FfPkMMa2XuBbDylvO7tug7KR/TTZ78=; 25:y3BulFPr1Wj2UiUzIcQErZoxZrBS2JCAA41F739BiH6AkWEbhrVOlcclEtHChNLo7GCNNiZTWAwyPflNsrdqeIZ2fgTQYbgxR7y8h6pc0/oCHoI5144DHOiYLtbh35at7shWS9L6PKWue6RWiexEaaa+MI6l1OzNKTV1oJDtCA1D32++Yu0vir0ZmMVJXsR1/Hsh2qdv4yQCJPcKSFANQkJIsJc6hpZ2g8HfWoYLsK5vH9VMW+ajHT9NCmctGVErSUK9u+r2MVKBs8aZW57/CU5Gu7x/nThEs32YnUDmNTVPowLvCjj872D/zMASvIDKDoIrEegK80Jwf3G2LtqJgw== X-MS-TrafficTypeDiagnostic: SN1PR02MB1631: X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1631; 31:hVADJLpYA+euj5IMpWkY1KfaYv2pwO1mAwJSOU/CtGTmBeWHS2LqVD0epfQJ8fO6p5KE+ZKdRyND8AgDqVbrLOwoQFTOzfLLhFBKWmeZ+PTUbdzWPxlO6qK73TkPxCBLMEMH/z864N5q+A2C5cRtduGwRfUi4ke/Y9BF5sQoscb4e1jfGASI0kUf3l1AnNDSoLZofgz9mZSTpnDKNXwpAszh22gq22pWNlkWlX4K60c=; 20:D4grhq0wQTcJWz3QQxopKWR2Rg9HVlmmyaREns0lGpRBA/vHIiR4Igw2k1HcEWOrSd+0OktXyq8hnJGDgv46X77Ma7FwB6NL73lnWE207q/ieShATTQUalYlQInJHviCWKtYWRDbjSghi4qRQuqRQpD7+MtssTzfzulS7OeUBTQr5Q8YNr+kVlTy2cH4YDgcJsXKmDR8AtLqiS4ZxbadeGbUNIgOS1yuGg8ApT9ueF5C4WN92D71+Ujr8SOBp6xS+Md/EE+EDZ0J4WKIpxwQ8D/6Z1jabzFb3sBU1TeE7OaS+TIt6ldJ2QfeVT78957opTi7Y0FreesJleJlDtoPh4gIAqBu7oLhoLDA7ealVaz+myTUbS6VM3yN3KrXqrrMteutBDh05RUo+2NZPNWmOFGTxJ6DlfndzLcb3BFi8MNkaKEaIDG+i4mm6I/B450OciwwWRjdt8hupdys9zZEkLJkOTkUw3H4ajY9c9bo0VyfSg2A9HIq9PBkJ/5uMnNX X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93004095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:SN1PR02MB1631; BCL:0; PCL:0; RULEID:; SRVR:SN1PR02MB1631; X-Microsoft-Exchange-Diagnostics: 1; S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0OdNtNSiPkebf6jUZYI+QSIYeePQ4ZGaNYPHxtgDsn+g+Ld6YpCh6JCFip1qDeCePiOy9wCx+VjigqbbNRBhVHcaRfahDyaJsgOSujaERArkG+sVeptcn8459MtfBujrmRhwVH27PO5bJX4InwJ7Qvyqe+Z3BzDWXAa7XAUzd0YGlFE4I0MqXKvWlZuBbm9IoAHvhn5gf13D/2HRkIQb7Vs37a9jBdNaWSktFyMFj/ccmcCqpoY71GqRUJAZn0M1Hk1NQxptMx/kP4kjq7HTCm8JALfJC9uor8ymLF90pUdQxy4G7o2Oq23uNBK5iqsCUJrvNQCMQzm5jziZs+9rL1zTAfmmQZtvAsgYO6vTpI3lx8G9hmnkg==; 5:auPwziewCN55Oc0v6MVPOl9YoHtHVpxYSzteMyXUvDf+bDLASb37eUGsYWWFwi0wzMcpQXmgfSqv34vju52ibWfvMfLkNiRe2GiA1PhNfcwbpw/P8YkcDosQ1Kcm3KQX5+nslAoEmJ7awCJBIVhZjv+6civI0Vz1NrK3cyyZ8iU=; 7:qx37gLIpS/Q8MtWCImZGBVfHbYx7ZybNUubqSLn0R26Lzn6URGsLckdPgZjK7wm0sauwMuaWkZulNZTiWjKKDjsRkDmacc7W9lWIoDjRKHkPKllR9iExq9pisZXWVPXluwsfxcftoFZX6Mwbt0/0j7+P4jtake3Hd4bU4JFPW1hliUF4i+nCmcY5bgrilUzLTFVBSX+Vsh6KfwnO0/h8StThq7kuwYVUxZNM+vyDCa2M4u3NIfnyu5gIC8IK9hef SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2018 15:02:26.9390 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f803ba1-93c3-4ea3-931d-08d5f0ad4dfd X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB1631 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180723_080244_143277_A501883D X-CRM114-Status: GOOD ( 10.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, sgoud@xilinx.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, anirudh@xilinx.com 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 This patch adds check for return values from clock related functions. This was reported by static code analysis tool. Signed-off-by: Manish Narani --- drivers/iio/adc/xilinx-xadc-core.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 0127e85..23395fc 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -340,6 +340,8 @@ static int xadc_zynq_setup(struct platform_device *pdev, xadc->zynq_intmask = ~0; pcap_rate = clk_get_rate(xadc->clk); + if (!pcap_rate) + return -EINVAL; if (tck_rate > pcap_rate / 2) { div = 2; @@ -887,6 +889,9 @@ static int xadc_write_raw(struct iio_dev *indio_dev, unsigned long clk_rate = xadc_get_dclk_rate(xadc); unsigned int div; + if (!clk_rate) + return -EINVAL; + if (info != IIO_CHAN_INFO_SAMP_FREQ) return -EINVAL; @@ -1237,8 +1242,10 @@ static int xadc_probe(struct platform_device *pdev) goto err_free_irq; /* Disable all alarms */ - xadc_update_adc_reg(xadc, XADC_REG_CONF1, XADC_CONF1_ALARM_MASK, - XADC_CONF1_ALARM_MASK); + ret = xadc_update_adc_reg(xadc, XADC_REG_CONF1, XADC_CONF1_ALARM_MASK, + XADC_CONF1_ALARM_MASK); + if (ret) + goto err_free_irq; /* Set thresholds to min/max */ for (i = 0; i < 16; i++) {