Received: by 10.223.164.202 with SMTP id h10csp2373934wrb; Sat, 18 Nov 2017 20:36:08 -0800 (PST) X-Google-Smtp-Source: AGs4zMaOgGAu3m8mz5YQdlBTM+5rcK5m82qVfK1NsGNtjOl1eKbdV0gg38k/jjpy/J9LlIpIuZz3 X-Received: by 10.159.206.200 with SMTP id x8mr5237427plo.273.1511066167913; Sat, 18 Nov 2017 20:36:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511066167; cv=none; d=google.com; s=arc-20160816; b=Jq1c0TdFgKKjcoCl4WUh7nFAMp+SXuvEbAWGVXMhqv9kBAF6oLh/EFF3cnqDXSEc1C js52qzoAPPoEe6Bw5HeOY8Htuu4u7RcL5QcEtbb5Ot4kcUs53Yc/Z4vHE1ps+KVAVcqM 5WfdMJ872qyy7qFLhn9d04DujoAnYVHwnqTp7AAGHivwDwaDgqBrfXYAbYWGlNUhh3gk ll8tnxWi4azF8e89QTIlnV9PoYhx3s/wpDzEl1xMqo5rrx3ogmA617EdchRlZ8fU9xZl GGLhI8H0fEcScD61HDR5vXv+uYYCu06Fdu/0sI68LTvIjvCRGNPC+owjQVoCIzoNuEOH V7lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=AOOd+JK1Yno4LWvzc8Von3i/Hq0sqV1eIuA4/FoSDDU=; b=SL+iLGYTAjl+fhMHbyqTbxF2bEUJqJdZk+q35OJFkDWbvMs4AqGJxQQpZ+Rz8cwH/D LvitCOKMdqPlVM2qEaN4R9/Npi+KB74bWObdMCwqWmQShXv8bJa1Xd9s15gFkGfPR4P2 +6vwnUktIrzLmYGroSKvfSrRFQMYHYpC2ZLo81YHkUozKwa/p6K2gxgJajPdWRllRnI1 DWoK6DU74IPgYd8Iek+xYmCGLlynuhk9OoAUjG9NKEFCJIVqJgA3BTke3R+ZAsbTm7GO hqdxEvAyjMgWjbeV4IHh2lUBvtw4BoIfGN5K4cEdBvWEzBQ7tx40N17WSDax7seuNJWw Orgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lwIBDc/D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si5309958pgp.587.2017.11.18.20.35.54; Sat, 18 Nov 2017 20:36:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lwIBDc/D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750815AbdKSEeP (ORCPT + 75 others); Sat, 18 Nov 2017 23:34:15 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36950 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbdKSEeL (ORCPT ); Sat, 18 Nov 2017 23:34:11 -0500 Received: by mail-pf0-f193.google.com with SMTP id t69so4858219pfg.4 for ; Sat, 18 Nov 2017 20:34:11 -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; bh=AOOd+JK1Yno4LWvzc8Von3i/Hq0sqV1eIuA4/FoSDDU=; b=lwIBDc/DfaWKJKCU2yZk5dCE/bikcIHaP9mZ0dA9EoQLOk8sUQqsS2RNj0KnocJjHg KjV14FzM58Lk4jtqqcc8sZmhGWFpCFUyRIXxS1Ox0EaoXpJGGRhvC93Kl6kpdcEw5pbE RrlL9LSl8GQQE1uALx1WphNlobrtWL/XfqmLCYs0Znp98w6o+66V+fZqW2Jz85kvB7zE ejS4GkxDoIpfTiZ0T6tiG0tgsAN2x6BsXAlytw8WH4YjuKlx+7omNOF0pzY4Sc3ru7a6 megUzM9IGSYkYpSGnQIq5SAD5qlKoWQsejJGF+CrACyiGgkKGsEjMOpwEj4r3psyxijK gzTQ== 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; bh=AOOd+JK1Yno4LWvzc8Von3i/Hq0sqV1eIuA4/FoSDDU=; b=k3KqS+zf6883Ho/vhbIG/mi6/kEC93Ph2Y9vhj2Sl8rO2EXyhzMel1xi2NZABFdPV4 EMzdLsLN1v/czr9ibAK5THRAOBBDGsG3c9VIAiWlQcZZKog5HrimpFPcxCjybWH0dJRs 4IjfmG12+D8IPcswRRSsYrLkeojrVzLfSfmoBrA2I5Qoet5bsQY6z/LwZK70J6pG9gug L9RpD2f/H6PrMO9P6GAh2cd9D9DGiCKLhApjfm7qAStOTgNOpwGVHBp6yeTwecwIWoXK 9Ir/EHW4FdDszLcU9L645Zdx+Zw7RIisiU+MJkgHQ1bxaqIU6cjh3IkzwdWWqpC+WM5/ BWHA== X-Gm-Message-State: AJaThX7QF1aIfpH6FmLyjAWMKoVYHr9TFLrhp7mMiNATG9YDf3jVbChU a7xjEw7cojfV4gK715oFiyY= X-Received: by 10.159.255.70 with SMTP id u6mr9915314pls.372.1511066051197; Sat, 18 Nov 2017 20:34:11 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id u68sm13955257pfu.154.2017.11.18.20.34.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:34:10 -0800 (PST) From: Arvind Yadav To: arnd@arndb.de, gregkh@linuxfoundation.org, joel@jms.id.au, nicolas.ferre@microchip.com, alexandre.belloni@free-electrons.com, linux@armlinux.org.uk Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2 v3] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking Date: Sun, 19 Nov 2017 10:04:00 +0530 Message-Id: <3ce95a4e4eb4476b19868f36cd1f11e4b62b6203.1511065797.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The platform_get_irq() function returns negative if an error occurs. zero or positive number on success. platform_get_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav --- changes in v2 : Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid. changes in v3: Return -ENODEV instead of lpc_snoop->irq. drivers/misc/aspeed-lpc-snoop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c index cb78c98..e3be88f 100644 --- a/drivers/misc/aspeed-lpc-snoop.c +++ b/drivers/misc/aspeed-lpc-snoop.c @@ -115,7 +115,7 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop, int rc; lpc_snoop->irq = platform_get_irq(pdev, 0); - if (!lpc_snoop->irq) + if (lpc_snoop->irq <= 0) return -ENODEV; rc = devm_request_irq(dev, lpc_snoop->irq, -- 2.7.4 From 1584483230277860622@xxx Sun Nov 19 08:42:41 +0000 2017 X-GM-THRID: 1583900168797657091 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread