Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp303992yba; Fri, 5 Apr 2019 07:05:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwK5lF+UnZAvrZSQDYPOMyMIc9mMfRxTPVLn7kQKhJ9mL6uxuGCTpoXki0ETQfsbMltczlU X-Received: by 2002:a65:654c:: with SMTP id a12mr12375870pgw.101.1554473132528; Fri, 05 Apr 2019 07:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554473132; cv=none; d=google.com; s=arc-20160816; b=ziasjFuZE7B6C3dl6w6Tvn1KdSdsRtandxT4LwerbpKKm7PQvmrGETunfQXbj9xbsD /NnE2YKgZ/tbeaJZtrQu2mfn1XMenYUax7RB+3rNFCwnJuMx7XiHcDezLWau8giMvtsF wQURSL2Fio1v5C4kckV9Zv5P/gAQ++EJX22/9ZRDywJ/HnOYiZjSs6FKbWTn50WL8RMY G9+XchCrsMl5SpkJ/6n+VY60qHapRyZwBCmD0eoRLlvEBg6xflsXMG/pI878qyxd9AqO m6eDZRl7bnqm1CDNEfhtaYL1d0Ps+8kGwM+CQp7NUra59eefhFFMmOuQ1rZJCrlRd5Zz YT8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7wot8VmJ2vfCDCmXzxAdu0huuOariKrTjjcJN3FjTxg=; b=Mpa++SsNni1sbY75xb4NvpoHerFXHKRKBw4iDugR0Rrbs/wMA3/yng+L7bXxnLqLCZ mLfpXU6u7PHOayBxQIO9ejX9ctBagwIpgYfVdk0gn7H6xwpbaqHKSqZPad7GezFJJif/ Gyi5aUkai9Dzoq3PVPIqCc/4bOMB+8UXxZFoSyicsjWHsoQU7jtTe0skTjrhuC8YCMEH JzGSnJV49lPIq/Ivw5zDin3KTJ62PhV5cyP5agXmz0zLpb7JTmJ+EtE+sSwis8Msc1it M9K3m4W6fx0kGAHjYLFNQ55D3rp25kBNELCD6V1L6f8iIdJJITyQh02Ur/SIL43xlj8J HRjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P+FobSaX; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb16si10656898plb.227.2019.04.05.07.05.15; Fri, 05 Apr 2019 07:05:32 -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=P+FobSaX; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730827AbfDEOEU (ORCPT + 99 others); Fri, 5 Apr 2019 10:04:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:50160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727212AbfDEOET (ORCPT ); Fri, 5 Apr 2019 10:04:19 -0400 Received: from earth.universe (host-091-097-083-087.ewe-ip-backbone.de [91.97.83.87]) (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 25B8921850; Fri, 5 Apr 2019 14:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554473058; bh=tXofxIeRxSbVJICOj67+SiNUoai6W5vF0h3jC8BRAAc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P+FobSaXOchwscsPNV7rKq/JZwOdLHT02xkh8BevXErAgV2hIthWv4HOpTVyKzCja IaEea7rPCHLnV3zu3DxTaOp9HSiomNAHMWSsfBLfbKBMTa2hY0c+uCOSQ1Hg08lyMW VUVDfAqKV/VfiynyflEjt3lojNeFjPqaSyoQMUIE= Received: by earth.universe (Postfix, from userid 1000) id 599373C08D5; Fri, 5 Apr 2019 16:04:16 +0200 (CEST) Date: Fri, 5 Apr 2019 16:04:16 +0200 From: Sebastian Reichel To: Hans de Goede Cc: "Gustavo A. R. Silva" , Chen-Yu Tsai , Ramakrishna Pallala , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] power: supply: axp288_charger: Fix unchecked return value Message-ID: <20190405140416.5drwsaciiipaa626@earth.universe> References: <20190318161439.GA6245@embeddedor> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="v4x564h5nq5jwjac" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --v4x564h5nq5jwjac Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Mar 18, 2019 at 06:32:35PM +0100, Hans de Goede wrote: > Hi, >=20 > On 18-03-19 17:14, Gustavo A. R. Silva wrote: > > 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(). > >=20 > > Fix this by adding a proper check, a message reporting any errors > > and returning *pirq* > >=20 > > 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 > > --- > > drivers/power/supply/axp288_charger.c | 4 ++++ > > 1 file changed, 4 insertions(+) > >=20 > > diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supp= ly/axp288_charger.c > > index f8c6da9277b3..00b961890a38 100644 > > --- a/drivers/power/supply/axp288_charger.c > > +++ b/drivers/power/supply/axp288_charger.c > > @@ -833,6 +833,10 @@ static int axp288_charger_probe(struct platform_de= vice *pdev) > > /* Register charger interrupts */ > > for (i =3D 0; i < CHRG_INTR_END; i++) { > > pirq =3D 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] =3D regmap_irq_get_virq(info->regmap_irqc, pirq); > > if (info->irq[i] < 0) { > > dev_warn(&info->pdev->dev, > >=20 >=20 > Patch looks good to me: >=20 > Reviewed-by: Hans de Goede Thanks, queued. -- Sebastian --v4x564h5nq5jwjac Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlynYGAACgkQ2O7X88g7 +pq8vA//eN4OarDl2zaxXoMbmcPg6MH8MglCdNeKSv17IjTlOmB0gqHWPL70L7VQ 0MQrw6xh6NAqpI7toux3uzNycRgddQBTV9WyDs6Ry8b7xrcV9QhweECuFOqypwJe RQmn+zkHgl84O4UC5DR3mVnHpxVTryZ1wpL7mVxJIQuQki1tDJDcsSepniyBb70Y 1enxIVp/CXD5haKmXDHbVKn055RBye5aRa+iIgN/ng7ecJ0xBp4owqj1UU31i0MX 6Y+9F3j6+i9bKrLVjWzl1MQwnK0s1AE+XXy1jD05Pke5c6ffE012+683R4CWlugv npaTgdfiEJvIYfFjW8zp+FJRSjxPgLxfPocv1c74ajIWjzmcHeKOhMvsSLtO5wfz 6XAQdWOIQiKVlyvhk8zkC9rkHJ2jvVYs0Nte9U0HCoGCGJ5SjW3QHFA8mX5pX2NH SVyr3gOgVw2r1aIAW8+QZqawQ9TOcXuIKk9fjH/WwFR9yHy7Ozn42hgdJ/LnQtHP 5OKnwqKp9LWqffTj2Yt3w+dkhJcgHlPadidSetpATUt2JumfEBSYgL3s65jlF1m9 6taemwpXLHFoLvakJMM+iBjzhaPnrV/k6Rbx8c/uG8WFg0fQb0UZJVaU+2awrqmy YTtHYPuYguprytU/Wy0repRDfeTE3pYEJcBp+MwHRcKsMphu/j8= =QiiC -----END PGP SIGNATURE----- --v4x564h5nq5jwjac--