Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4049193ybp; Sun, 13 Oct 2019 20:57:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTayk9UtD5PvgVtNDmQnYCfHrtpZKQeEBOx4wevEFXzyuQhYnN19swfEfbbiubQEqBTeRp X-Received: by 2002:aa7:c257:: with SMTP id y23mr26281600edo.39.1571025446792; Sun, 13 Oct 2019 20:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571025446; cv=none; d=google.com; s=arc-20160816; b=H6kg83VgGHkpZR2Y047p3lZZ5UwAFwusnePqFoKjrYthqAdpYdO66haVjpeWgGsDvj SuRpyX39DciIWqw5GlbIEsR6uArnmuSA/7EiIuqeqN2VyrEvL1M9RW2nNaCHypUlKMOb ZY1J8XXObqT2jWvek0clsiMjiNymTSTGGWTBeVSL8Zl9ewxc3pWOb7UkwiXb85/q407y gCz00B1OnO5zU43ENfOnO6YkgedVExSDo9tfI/4hyvsQTIrDpy4Za2Cl2jUjS9V6iUmw 5/JlieGTMN/W/ogxc+VYlj/4GYIgalfc31JGkPF2OqmJdI0uhV7KYQ7WtIEby7DxiFBG Q1nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:ironport-phdr:ironport-sdr :dkim-signature; bh=x2KVWmKIsjNyLmGyKFy55mcaTZ+9zn5g8XpBLCOjHvI=; b=mspZ6DpqiZ4x9LktCgZzqT1i4+/WeVrVnoTnmQqkPUkjL/PFMFuFFi0DFl7+JBAXhX fTF8aN7Oo4NjLz8TVpGtEiRJcsYyqxKQXp2hBJElQmG/evvPJ43qPPQLiYAMcwv3Vwkw wDrux4q0q+20iCaVBYXDPAubprZWn8CmNbfUgiHKvy/NhtjBD/6y8kupaK7L6c4KnYHH /jzzmMsQzJzbwhHVQP9wiRuQumf3J+giIgZFulx4RC5fUAZ9/6I/aC3pfO4UVN0jLokA qz8uMO9hYDhLUI4GQzxQK+6OCpBbGXctTV9AV9n3HjrHjb8TbTtqfXtMOoR+bZNWfvuZ vaZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ucr.edu header.s=selector3 header.b="Zr/BdkyZ"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ucr.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h20si11149560edb.218.2019.10.13.20.57.02; Sun, 13 Oct 2019 20:57:26 -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=fail header.i=@ucr.edu header.s=selector3 header.b="Zr/BdkyZ"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ucr.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729778AbfJNDz6 (ORCPT + 99 others); Sun, 13 Oct 2019 23:55:58 -0400 Received: from mx3.ucr.edu ([138.23.248.64]:27644 "EHLO mx3.ucr.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729706AbfJNDz6 (ORCPT ); Sun, 13 Oct 2019 23:55:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ucr.edu; i=@ucr.edu; q=dns/txt; s=selector3; t=1571025358; x=1602561358; h=mime-version:references:in-reply-to:from:date:message-id: subject:to:cc; bh=pOn1r0uMbFxPbRmdPlkJRD5BpRWveMVLcjOhf0EWA0w=; b=Zr/BdkyZL4wgmoH6z7Aulw0LNXuszEuueXMhaDd6sCZ91Au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/2HWksxwjbxUoBS9pxxk3oXYZJiZOOdicq/BeN8XQ3?= =?us-ascii?q?dKUMRMWCxbGo6zYIUPAOgBM+hWrIfzukUAogelCAmwGO/i0CNEimPq0aA41e?= =?us-ascii?q?kqDAHI3BYnH9ILqHnbrtT1NaYSUeCoy6nD0DbMb/NM1jf89YPFdRAgoPCMXb?= =?us-ascii?q?1qcMrd1VUjGg3eg1WNtYPlJSmZ2foQvGiG9udtU/+khW0/qwxpvDSj2sMhhp?= =?us-ascii?q?PKi48V0FzI6zl1zYUvKdGlTEN2ZdipG4ZKuS6ALYt5WMYiTnltuCY917IJp4?= =?us-ascii?q?a2fDMPyJQ73x7fbOGHc5SQ7hLjSumRJTB4iWpgeL2lhhay9VGsyun+VsWpyV?= =?us-ascii?q?pKoDdJn93Iu3wX2BzT7c+HSvR5/ki/wzqAywfT6uRcLUA1k6rUNYIhz6Yump?= =?us-ascii?q?YPtUnPBCz7lUXsgKOIakkp+fKk5/njb7jivpOcMpV7igD6MqQggMy/BuE4Px?= =?us-ascii?q?AOXmma+eSzzrzj8VHlTLhElfA2j7XWsIrAKcsFu6G5HhdZ0pw/5BanEzemzN?= =?us-ascii?q?MYkGEDLFJEfhKHkofoN0jNIP/mF/e/hUqjkDNwyvDYMb3uHI/NImLAkLj/Z7?= =?us-ascii?q?Z97VBTyA4pwdBY/ZJUBeJJHPWmYUL7vcfEDxY/eza5wu3nBdE1gpgEVEqMD7?= =?us-ascii?q?WfPaeUtkWHsLEBOe6JMb4UqjbgLLAX5/fvxSsoi18UfPHxhrMKY2r+E/h7dR?= =?us-ascii?q?bKKUHwi8sMRD9Z9jE1S/bn3RjbCWZe?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EGAgBS8aNdh8fQVdFmHgELHIFwC4N?= =?us-ascii?q?fMyqEJI5ggg+ZLIF7AQgBAQEOLwEBhEACgl8kNAkOAgMJAQEFAQEBAQEFBAE?= =?us-ascii?q?BAhABAQEIDQkIKYVAgjopAYM9AQEBAxIRVhALCwMKAgImAgIiEgEFARwGEyK?= =?us-ascii?q?DAIJ4pB2BAzyLJoEyiGIBCQ2BSBJ6KIwOgheDbjU+hCiDKoJeBIE5AQEBlS+?= =?us-ascii?q?WVwEGAoIQFIxUiEUbmUAtjBSbPA8jgS+CEjMaJX8GZ4FOUBAUgWmOTCQwkSg?= =?us-ascii?q?BAQ?= X-IPAS-Result: =?us-ascii?q?A2EGAgBS8aNdh8fQVdFmHgELHIFwC4NfMyqEJI5ggg+ZL?= =?us-ascii?q?IF7AQgBAQEOLwEBhEACgl8kNAkOAgMJAQEFAQEBAQEFBAEBAhABAQEIDQkIK?= =?us-ascii?q?YVAgjopAYM9AQEBAxIRVhALCwMKAgImAgIiEgEFARwGEyKDAIJ4pB2BAzyLJ?= =?us-ascii?q?oEyiGIBCQ2BSBJ6KIwOgheDbjU+hCiDKoJeBIE5AQEBlS+WVwEGAoIQFIxUi?= =?us-ascii?q?EUbmUAtjBSbPA8jgS+CEjMaJX8GZ4FOUBAUgWmOTCQwkSgBAQ?= X-IronPort-AV: E=Sophos;i="5.67,294,1566889200"; d="scan'208";a="87238372" Received: from mail-lj1-f199.google.com ([209.85.208.199]) by smtp3.ucr.edu with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 13 Oct 2019 20:55:55 -0700 Received: by mail-lj1-f199.google.com with SMTP id h19so3039810ljc.5 for ; Sun, 13 Oct 2019 20:55:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x2KVWmKIsjNyLmGyKFy55mcaTZ+9zn5g8XpBLCOjHvI=; b=fIQjmX0mgg9wF/MqwZnL6IFtCd2BSwL4zvFL6Es4eY6e9AAdbfvhIPSAMLCDdEGFgI 1NRAcsyMwC6g3ipHLctTQx5e6IY5P0x76U7/ur3rPvPy9DeWgFqh39Sg2ZDXt16F5uLg 5rP35pQyd+Uca1hYcCwOt5KZcL4gSixV4tBsAnQ+H/EZ7t9IAZe2A43zAdDlPt/Ogi37 oaLFjllReT4FpnmIc3uo0uoIHAFkQO8KDTojlyN7YWmaxndda/p0kJixx0fGRXU5/RFf eJcbsO3SNvIM42XKwktNkqYvCoyp0FMllcZTx0ktg5NaL+DzUBU0QZwBtNmAWu/iUOEP byiQ== X-Gm-Message-State: APjAAAWFb6fVm/iwau3OmjYUmc0xI7fwoK9/9T4XcpQvyeHtVdN8+XLO fe+KstNVNUkjxAWxhZsUczfHi4LOjtoZCQECwwNZPDJpoFFQnUjvfuU/0YWbjt/mSY2Cxad4OMC hDvyibC6Ds4KFHKMUcWYmN5v4afuUpb+0EVlk6WcA2Q== X-Received: by 2002:a2e:9890:: with SMTP id b16mr16909122ljj.181.1571025352260; Sun, 13 Oct 2019 20:55:52 -0700 (PDT) X-Received: by 2002:a2e:9890:: with SMTP id b16mr16909116ljj.181.1571025352056; Sun, 13 Oct 2019 20:55:52 -0700 (PDT) MIME-Version: 1.0 References: <20191014031238.fqiytckizbrwntci@earth.universe> In-Reply-To: <20191014031238.fqiytckizbrwntci@earth.universe> From: Yizhuo Zhai Date: Sun, 13 Oct 2019 20:55:40 -0700 Message-ID: Subject: Re: Potential uninitialized variables in power: supply: rt5033_battery: To: Sebastian Reichel Cc: Beomho Seo , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhiyun Qian , Chengyu Song Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sebastian: Thanks for your explanation and I will send the patch accordingly. On Sun, Oct 13, 2019 at 8:12 PM Sebastian Reichel wrote: > > Hi, > > On Thu, Oct 03, 2019 at 09:21:44PM -0700, Yizhuo Zhai wrote: > > drivers/power/supply/rt5033_battery.c: > > > > 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. > > > > Also, we cannot simply return -EINVAL in rt5033_battery_get_present() > > because it's not an acceptable return value. > > > > 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 -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside