Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp273024yba; Mon, 20 May 2019 08:28:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRPhvABS8CY1iupHAcaWKRZDmpKsTrWs9+OFiKskYkxo1tdX2krYMg51U9k/xIQncBlaWV X-Received: by 2002:a17:902:a611:: with SMTP id u17mr41764521plq.38.1558366111110; Mon, 20 May 2019 08:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558366111; cv=none; d=google.com; s=arc-20160816; b=qYYh+4ixNTu/EPgR+dhiG9GkBsk1eME1A/ZeNZ/LoaBYdD37hxX+G2McAeVBhP75Oc zk9teQFmsaWagdf+R1diUPlcXoyrSEXL+FG/VoDSFgs369u02ky/nfsM6dC0v/212fHn bcI6M/r7eULc1cCgqCnUI7ngM5KL5VWqbM7BNaeUVtWVCQ+kct4Ww5lGX0RsjgvITB1x Ketobw70lWheyTtnj2atbiBRwsz4/djazVLLIdEkQxhXDN0ZVEt93HmUQEjyf8r5GrVG uul4hnFhiUsTVgCc+igvaFeeyyc4FlOTjK//2+x6R5Nv5vvKOQBXCwYdvNR96RvPkMN/ UX6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IaxqCSLVyxXozXuTLvr6N8iQrCB32AH9IERd+n+YOJU=; b=tQeD2dGd5sczvd4AASO1urUJMxE5VeBeLLP7QHQko2Q50rXYuRaZXto+ccXhTdB9bx Y+p703SQ8t6RHpO60n9xLAyckhevoOBqIlJk/z7MOBVRbIZdShTakT/DaPyoAxfZ33xP opJCx5mE/TrxK7w01OMjjvw5D/4TF8fdaIEzVKfdBKYv4RmWLDbba43gKwJ8Qu4Oz78x o/aaKqFDS/kokKBlD8mFmN4kRL8mDwdJNYT3x0JWZHvWcOTcN+DmQz/vKphzVMKcGqV4 zJpWk2mzZW0KVSs7Fr7UuQfK7NVXhoVijLqRBfdoumaFULg/QO7LTXG1owq7/06UUeoH CwUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JP1SmMXw; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r130si17271341pgr.509.2019.05.20.08.28.16; Mon, 20 May 2019 08:28:31 -0700 (PDT) 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=@kernel.org header.s=default header.b=JP1SmMXw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388495AbfETMXB (ORCPT + 99 others); Mon, 20 May 2019 08:23:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:37064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387767AbfETMWx (ORCPT ); Mon, 20 May 2019 08:22:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3EF9E214AE; Mon, 20 May 2019 12:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558354972; bh=zfS+tafhgl+KxH3yuXDCnV/5oruOSkTddix6yyBhaWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JP1SmMXwHoNpwRWSKTup2tZVaWgb+TeAdXsXmeDUkMz85MpL2/BJ5i2I+Byj7bxb/ 4bC/rZiGBAVIlSQ9i7UhsGXK63yizDVGR56vVhT2lzN/IQBjfswdUlabvlH0v1nNoi Wo2cHoSnEf/iPxDlABsaW1093BoanHQcXVuvmiYw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , Hans de Goede , Sebastian Reichel Subject: [PATCH 4.19 010/105] power: supply: axp288_charger: Fix unchecked return value Date: Mon, 20 May 2019 14:13:16 +0200 Message-Id: <20190520115247.763133797@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115247.060821231@linuxfoundation.org> References: <20190520115247.060821231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gustavo A. R. Silva commit c3422ad5f84a66739ec6a37251ca27638c85b6be upstream. Currently there is no check on platform_get_irq() return value in case it fails, hence never actually reporting any errors and causing unexpected behavior when using such value as argument for function regmap_irq_get_virq(). Fix this by adding a proper check, a message reporting any errors and returning *pirq* Addresses-Coverity-ID: 1443940 ("Improper use of negative value") Fixes: 843735b788a4 ("power: axp288_charger: axp288 charger driver") Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Reviewed-by: Hans de Goede Signed-off-by: Sebastian Reichel Signed-off-by: Greg Kroah-Hartman --- drivers/power/supply/axp288_charger.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/power/supply/axp288_charger.c +++ b/drivers/power/supply/axp288_charger.c @@ -832,6 +832,10 @@ static int axp288_charger_probe(struct p /* Register charger interrupts */ for (i = 0; i < CHRG_INTR_END; i++) { pirq = platform_get_irq(info->pdev, i); + if (pirq < 0) { + dev_err(&pdev->dev, "Failed to get IRQ: %d\n", pirq); + return pirq; + } info->irq[i] = regmap_irq_get_virq(info->regmap_irqc, pirq); if (info->irq[i] < 0) { dev_warn(&info->pdev->dev,