From patchwork Mon Dec 4 17:48:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10091211 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 8F47C6035E for ; Mon, 4 Dec 2017 17:50:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F10D2919A for ; Mon, 4 Dec 2017 17:50:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58338291BF; Mon, 4 Dec 2017 17:50:18 +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.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 922FC291D2 for ; Mon, 4 Dec 2017 17:50:17 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=hbcSSyv89RGo2TTJM8iKjCQl+ZQ2EH38jLLyx1Hv/UU=; b=FrITRU7fRZvqhatTVrWVpBCgKU piO/0l7pPqNDwqHizcWR1h5CgtAtpFENKT1hbrcH5DaVy70GxxajAzSmFy8nlLZ1b5bbXUkIcxrXn 9fTJtgdjX/kjfLAUSkddxu/0FXuqcts9DMIIejs4lkXUj7x2DAFXF4G5NI5Uu09UKF9vHAoHZ0Udi 0grbTBOrai1apbiolsltrSuaefaOll3YFUpLGieXXxhhiMf8cslWjaT2nE9o45PXjXZcMxuEQhrcV HKf+ISSOVWt7TnhWPq9H/YPwi2hFiaoT3dFmbPpcWkyimCjk6pCBlMGfr8qZhHjOroZ7u8uyhDdcA y6vfPlww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eLusi-00035S-Jd; Mon, 04 Dec 2017 17:50:16 +0000 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eLurf-0000p1-4C for linux-arm-kernel@lists.infradead.org; Mon, 04 Dec 2017 17:49:16 +0000 Received: by mail-pg0-x241.google.com with SMTP id w7so8697654pgv.6 for ; Mon, 04 Dec 2017 09:48:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a9XOSbs5CQZUxGIwxlLU8l//z1tddPklL65AwplANDU=; b=S2JrnyETsPLPzmfhh2/bO17CUtSjaNgQh6qkWC3LA0hI8gBgVCa36a6orUr4OK+ZT1 wAIyKtehFrh6P0hDLg4DIcKfoxNeLE3e3A8XTyRVjM6NYVigrnUETog+MPLwpaT60i9r e168VYm6wEjJQ9lzPFsxFLOa69TM57EJ4OG9UEWjHNv+M27advdkfVH+yXz5OckjK9UN /muJweou3un6K+jBLy7tUlgtsBfKH4NQLTAL4n4eiP+BF9VyD/QNvYgKEFl1Zycj4CYs Ac+ZV7R24hrkONSrpp4ycV5WdVj91yWHCM9jTAgSP3iJ6QzsxHa+E2a7/S/y++NMgq5/ o7cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=a9XOSbs5CQZUxGIwxlLU8l//z1tddPklL65AwplANDU=; b=F+jbs66hCZlE7rA2JLO/z2J3TUeTNe6A34CbDsIBwUw8YGt7+PoGdjaSuDqNBFV04s lgCC4nQCdUSfyiZ3UMHjUnDIIRMEXoi99G/eEVFzwlNo+lBSeXuIRhvahfDdDr+9TzvD enZ9sCyUIew+VWoBfYlMkqXCPdKzZ2HzaJ24w+vqLRRxxgqdEQ857EvwW2L2H5cHXLxB rdMQ3eeaNCXsXGsMjfvlCa2yXL3DMzMBpSPMmYNhitXpXxrTFUQs0LFDwvoqpeDlJSNU Hpmting78SojCFI8oLY3/JPlsmg7i0hlIDFMHanH9g68C+gLqS3imzt73zskfjkbKWsH KcXg== X-Gm-Message-State: AJaThX75IbwQUjjo2zg+y3Ryqi4zk1c1/FzbFQizzMxlJ9Jlp81i6UaH ZRbzmJWUQ6Up9Bg57Dh/oU0= X-Google-Smtp-Source: AGs4zMafzYYblOVydGMYU2pfhK+Gw2On31eX4qYiZpNg7hr/oQm/dpYy743ehzInvr5bHvv091tZNA== X-Received: by 10.98.55.3 with SMTP id e3mr19817946pfa.63.1512409730541; Mon, 04 Dec 2017 09:48:50 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id c79sm26098071pfj.49.2017.12.04.09.48.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Dec 2017 09:48:50 -0800 (PST) From: Arvind Yadav To: wg@grandegger.com, mkl@pengutronix.de, michal.simek@xilinx.com, opendmb@gmail.com, f.fainelli@gmail.com, davem@davemloft.net Subject: [PATCH 3/7 v2] can: xilinx: Fix platform_get_irq's error checking Date: Mon, 4 Dec 2017 23:18:19 +0530 Message-Id: <1512409703-20881-4-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512409703-20881-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1512409703-20881-1-git-send-email-arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171204_094911_690478_E52FED9C X-CRM114-Status: UNSURE ( 9.20 ) X-CRM114-Notice: Please train this message. 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: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- changes in v2: commit message was not correct. drivers/net/can/xilinx_can.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index 89aec07..1b859af 100644 --- a/drivers/net/can/xilinx_can.c +++ b/drivers/net/can/xilinx_can.c @@ -1111,6 +1111,10 @@ static int xcan_probe(struct platform_device *pdev) /* Get IRQ for the device */ ndev->irq = platform_get_irq(pdev, 0); + if (ndev->irq <= 0) { + ret = ndev->irq ? ndev->irq : -ENODEV; + goto err_free; + } ndev->flags |= IFF_ECHO; /* We support local echo */ platform_set_drvdata(pdev, ndev);