Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4023468ybp; Sun, 13 Oct 2019 20:16:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEHLxLCPaXiWWBzAUqy1cVlfPXwcBQC39ehvzDGQiFZ5hjVY/6tVAe+a3HJKVovVx5JB3X X-Received: by 2002:a17:907:2118:: with SMTP id qn24mr26222404ejb.141.1571023006428; Sun, 13 Oct 2019 20:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571023006; cv=none; d=google.com; s=arc-20160816; b=Hzv7tUhnzUKKSEqOmavFdpQW29sT7TwfESgl7FUJzxHCaTHVYjef+OqHEIBbmMt8mG jmXKkCouzh1/dK697o01R4b7FlNSpXxxVXCQ9q/ow7nJVW0ZfzOUqNvdwWpuuqrYGyUI NwCc6GQv1CMn2yyArycA5Ff+oPcglDnVP4PEjJJwuodDPKC11Tk+5qTKTxfXJ+A0GO+r HFRf4ap1+S3OCuhTNniEyhiV3tGyj6WdJwp/Kt8S7xz0rF0a0xr3vORE599y/Gyzj21d 2LYwyWB9o0SPfC4p211cXGI7CjvyOGs1PV4lSVw5U6AVA+hhQx95O0ShTWxbZafcjiZL M5zg== 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=f9++ssYlU32C3mD6GxFSvOSRuGIHHWu9gwvD+GnS4TI=; b=ZbJl1y7XOpJbba6FO92NvQkJ5oHE9ov2Oz/64bFIS09lp+p663FmLGLrYckhYUs+RI Xz5X6rP2Ni8U6pwdCiFukFwlrXe+1HwW/yCWzbp/+iw+eQBOxJrAyNYB64wph/DhsV8M 2DnktqbHFzBJEj/EMmKoEZI2EjV+BI3a/M9/W7ibJShQC9Utfr/TmMgs96b2/wtoXX8k aLaUUosmWwp6M3ECXdrDV1Z2aGtx09efo+5DqBBGSCyJVQy05LsN7xxBon59+SS+tseT zNEF/4eeNb9PVfnkocr6CmvCsWDNL8SVXGLiZk+kyyMpLMr0QWagUvtTfHs5UOJrEn4J nUaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rkjq2d1X; 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 c60si10867428edd.327.2019.10.13.20.16.22; Sun, 13 Oct 2019 20:16:46 -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=Rkjq2d1X; 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 S1729861AbfJNDMm (ORCPT + 99 others); Sun, 13 Oct 2019 23:12:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:60878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729621AbfJNDMm (ORCPT ); Sun, 13 Oct 2019 23:12:42 -0400 Received: from earth.universe (unknown [88.128.80.21]) (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 A52C22083B; Mon, 14 Oct 2019 03:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571022761; bh=f9++ssYlU32C3mD6GxFSvOSRuGIHHWu9gwvD+GnS4TI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Rkjq2d1XYhtZhEdpmX1Y8ImJrHnRKTnavJ3+5KQY4tHI0MdCEijUtJq3ojVaKrPBL JAdiHa4eBhfgfRw6/q1JhtYEOBjzI0cc4nQpp4+zJR+j5a3jGg980G0OWeEgav9+11 0yQ6/fiVqHC+UQ0cvYSjr94I9+jq00xDHYUP/yUo= Received: by earth.universe (Postfix, from userid 1000) id AC81D3C0CA1; Mon, 14 Oct 2019 05:12:38 +0200 (CEST) Date: Mon, 14 Oct 2019 05:12:38 +0200 From: Sebastian Reichel To: Yizhuo Zhai , Beomho Seo Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhiyun Qian , Chengyu Song Subject: Re: Potential uninitialized variables in power: supply: rt5033_battery: Message-ID: <20191014031238.fqiytckizbrwntci@earth.universe> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oguz6rorx46w3zrv" 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 --oguz6rorx46w3zrv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Thu, Oct 03, 2019 at 09:21:44PM -0700, Yizhuo Zhai wrote: > drivers/power/supply/rt5033_battery.c: >=20 > In function rt5033_battery_get_present(), variable "val" could be > uninitialized if regmap_read() returns -EINVAL. However, "val" is > used to decide the return value, which is potentially unsafe. >=20 > Also, we cannot simply return -EINVAL in rt5033_battery_get_present() > because it's not an acceptable return value. >=20 > Thanks for your time to check this case. Should be fine to just return false when regmap_read() fails. Will you prepare a patch for that? Thanks, -- Sebastian --oguz6rorx46w3zrv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAl2j56MACgkQ2O7X88g7 +pqEHg/9EW8LYtH5bHaYEn8WLUM+DKorgimr8m5w9WQp4yw4fjl+WzteTp6MdUdm 0a00kYbFxFVwffJBoy28MS2tFG/4T8+NqdE7JQeFnatAERlA4FJhzpxB/etA/9IE pbtETgg/r0qVLaLUKwlrqfWN0Dlo0g1t/QrKK7BaNWR2eZu0cGUI4O6k6s6C00u1 lyxXgUCkOgNEJSD4k664jcKIf3XboFZLanTghQ/uFerU9kH1gqCdSd51gxQ8eodu KlS3Eb4qcSWgLwrZLMtg/ewPa6KK9r+MRyQEipyK2ZyLEohlVhf+ZQ72R6+YM08M gmkr52vyzIVq673hPNGOVL9eUUQUKFLtJPDesQcdgPDlsEP2Vxs+EA7QEWIPTrSC AORM4pFjzpLiG+0aXbeX9TSA9xG2h+vpJ0rBTqbtl8syz2447rbzrgXirhhVI/06 4H0xmQXq9w8ctSW/qk/gJci1djcogYGes9lM8iN0mH2B++sC44vwgiHTe1b5h6IZ HeFDCzs8ZzIQR8Mk0aGYUMi/vCyhpBmVBO1JnZfecYmNAQ2XSlLu2yZeEsPh+jiW kld/CRSenBhE6oMb0f95UI5TG6Q4oVpUYtyyTRKoIMXf3PJwY84VI004M3+YhcAb e3EgTf2v8PSHF/s9pPBPurQ4bv/fkCNOFws++JsWDUTv23ekDE0= =GwVf -----END PGP SIGNATURE----- --oguz6rorx46w3zrv--