From patchwork Sat Dec 2 19:26:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10088993 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 8F22E60380 for ; Sat, 2 Dec 2017 19:28:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 807F62934A for ; Sat, 2 Dec 2017 19:28:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7467C2935B; Sat, 2 Dec 2017 19:28:02 +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 3B1AE2934A for ; Sat, 2 Dec 2017 19:28:02 +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=roEyI+RcEFasgDRlaedJDeDjhPvbVK6Y5EGdK9/5AgE=; b=XfEnLdHt8wHNDEMcpE2rY0VVgW tMyHDjJlSXNEEJj6SgQ5qELLLZrAauhbggOmQqPJ4wGu9ZSsj35mK84XpTJc6bidmmfgMKckR/EQ7 kJRjFSzXIS7sKaQ2cHQeLro20wdvC3n0/JIhmOvaycFHj2ol3og2/TckQi95R0pKpCm7Xo5SJSSyC 4ebjUIonTmO4DSLmKlCDsJ3lrVIsuR9PupY1X7i1iF4uiXLRf4B1a4tJEwZJF5D0HU/i7O34BA1Eu rcgCLAEyW5s0a7epR7U9TFGAvLC6pyQdWY4+bcmVeOC1TGtqqaaRF/MmBaesPwK17LpuyekwarBGX vSNUQxaw==; 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 1eLDSD-0001AQ-Dp; Sat, 02 Dec 2017 19:28:01 +0000 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eLDRG-0008TS-Fb for linux-arm-kernel@lists.infradead.org; Sat, 02 Dec 2017 19:27:05 +0000 Received: by mail-pl0-x243.google.com with SMTP id i6so8128948plt.13 for ; Sat, 02 Dec 2017 11:26:46 -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=2wkEKFnkLt6c0J6yaAdVLSQXa08/bN9qdqEhXeSys1Y=; b=FNY0ATTjfEafiCOER8P1nbQZKtVNKhIxkYkX5tFbOjV4NCR/gWwxFDI56v5QfNS8e9 6ny2eJ5n3bPodlJw0vB47TmTBrbxFlxLDB12dSBq7eAGYcbKYZEBC2NsrF3NrytIrptb vDusRex4T8sSzvWXyqXjAwVicp7NAiygTyvnPbef8feN/EOB/+bTqMEByvG9zv8fG9uP yGJ+zsYIexXJsEvIrSSXHx0MW2eElJQJeDT1YtTaAhvfnIQ6Hqxv8NzRXoaVJkleRUJp 4XNmyGzh/lJ+c3x9nJG6vSY7tefSfAwCDHDLOMn9mv+MpDXU3IP+yGS/JiCwbeMztFOD 3Dhw== 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=2wkEKFnkLt6c0J6yaAdVLSQXa08/bN9qdqEhXeSys1Y=; b=LB7VXfdCY46TKaBVTZqwqZqXLrZYSCT7mjqwJW3mAZqhTAyEEgtdzQ0nB6Glbo+khT CRSrue8UYoowQPoh3uCklmK/aAMmatv3EbGFykO4Y9jmY/Sap9ThinA/jUzlnVPU8/kM V2T8LGldp2ENfnvVm389W1tMQM5hsy/CHpvZoOc2U3VgJ+j+DReW/6ebFoZhdwCqf645 aPZkyBn5G9ZbOg8AvKqj9naDvTwcqSRGAE50WtskGL9dqZPq65A4Ew3kBFyG11n68zVv Zk7Qk09naPpGaVmMFtPQznPpJP/U3Bu8CNPUk+6prhjbSRqhWVWavDEy3bfNTRM7YDMx C2Kg== X-Gm-Message-State: AJaThX6iP+3biSD3Bfy5O7iigXUQEWrkTn4X+nZLNn33f/eK1Fy6Y1L9 IizSHfR6eJqi+ySHZAV8uFc= X-Google-Smtp-Source: AGs4zMaYE9dwhEp4pHPsXQSKYHvtswSOb0jMwZ8rxAqEc5n8tqql0OWsLrm/mB+YHUQ5i/Vr+8fX6w== X-Received: by 10.84.172.195 with SMTP id n61mr9969446plb.49.1512242806384; Sat, 02 Dec 2017 11:26:46 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id 140sm15167899pgd.85.2017.12.02.11.26.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 02 Dec 2017 11:26:45 -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, Vladislav.Zakharov@synopsys.com Subject: [PATCH 04/10] can: xilinx: Handle return value of platform_get_irq Date: Sun, 3 Dec 2017 00:56:16 +0530 Message-Id: <1512242782-7134-5-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1512242782-7134-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-20171202_112702_863441_92E63B9A X-CRM114-Status: UNSURE ( 9.14 ) 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 --- 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..e36e2a2 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);