Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp567717ybp; Fri, 4 Oct 2019 01:09:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTrpjmGEIY72VFZyCspAirOf336U8cRjipZtnzEr/e6OLwjQKDVYAryvJ6b/GLKvn8pbHQ X-Received: by 2002:a17:906:1998:: with SMTP id g24mr11092230ejd.305.1570176570578; Fri, 04 Oct 2019 01:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570176570; cv=none; d=google.com; s=arc-20160816; b=kHO0PMi+2tolqsiKdkGrhKedjsnCyuS3rYPAxCagVXPIhC8Gen4C/rIW4Dpmse+uGg iRP4m/+FZar94f/SAdSFpRdINzqnRQ5cBGjVLG24PthHCfzVoyDXlEQW/bCilFyhhkE3 aFID3YT1oq34IE3t6afIUftiJCjsn/285Vi3k5GqVv0+DBrzgn8W2LzkGL3DC7sHpwdh 3lmByzVbsrDtArYTkZ0hq+rPAu43gc7R1jYQ6fDhN7uDoZOeeuRApQ/waM/SpXxZQlqA dRTJUpAlpqe0IdZ30JdqscbPNBNacmnio0yiA0O/sOifgjj8NYBHVH4TYRBd136ecJ6x Bwnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :mime-version:ironport-phdr:ironport-sdr:dkim-signature; bh=amG90aSOmtrR07i+DuzkZAUHX9myFv9sjojIkK2vdYg=; b=KrLAOjNcFKFvDMKTHEfx4iSZ4Arg58LtbiBDkPlSLyV9f7qLfZlQVDQaVRGEeTGAN8 QdElREb7DMYmkMZGGMe7u8+VBh06veIq6Gmqsi0eRHHeTYb+i7IbF4fdc7c0tQNhg4tV 4Zl7OLfXLYlZ8NXTeS2WfMSFoHSXlGI3/t26aQodxUroD9pPsw93h8QYX8Jk8QJXxM6a jE9XuREtxtnfgnMOw6OYXcI1sIeSqH1CgRUfsOSbawd5mocAjsLVb/Wwize2sw1Z8r74 tlYg1w23lT8gkIujrl8NTIDQUpcU9gmczRTb/JxmD+WihHJnRDRoTZpysNIYoMcGAOr7 ZrBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ucr.edu header.s=selector3 header.b="ftmB/UvQ"; 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 u30si2595321edl.366.2019.10.04.01.09.06; Fri, 04 Oct 2019 01:09:30 -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="ftmB/UvQ"; 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 S2387693AbfJDEWB (ORCPT + 99 others); Fri, 4 Oct 2019 00:22:01 -0400 Received: from mx6.ucr.edu ([138.23.62.71]:58251 "EHLO mx6.ucr.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730396AbfJDEWB (ORCPT ); Fri, 4 Oct 2019 00:22:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ucr.edu; i=@ucr.edu; q=dns/txt; s=selector3; t=1570162921; x=1601698921; h=mime-version:from:date:message-id:subject:to; bh=Zz/4kUum/4LoqYB7Rvny12tH6aVFfBpG02v+rgY5AYc=; b=ftmB/UvQpIdwOuR72S+LoDfIPZDoiVwc+Bs3rc+cBA74ZAg8s1oNa8dV PIuM/lzF1JNhuKsvBNtoJ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fEcd8HWW?= =?us-ascii?q?ZNQsNdWipcCY2+coQPFfIMMulYoYfzpFUAsAWwChW3CePz1jNFnGP60bEm3+?= =?us-ascii?q?kjFwzNwQwuH8gJsHTRtNj6NqYSUOG1zKnVyjXIcvBZ2Tfn54jJbxsspvGNXL?= =?us-ascii?q?NwccXLyEkjCx/Jg1uLpIz4IzyVzP4BvHaG4Op9TO+ijXMspQJpojW32Msglo?= =?us-ascii?q?3EipgWx13E7yl13Yc4KN+iREN6ZdOpFoZbuTuAOItsWMwiRnlluCM9yrIbp5?= =?us-ascii?q?G2ZDMKyJE7xx7HbPyHbpSI7grjVOmPJTd4g2poeLeliBaz9Uis0+n8Vsep3F?= =?us-ascii?q?pToCpIk93BumoC1xzU7ciHRf998Vm71TmT0ADT7/lIIUEylaXFN54s2qA8mo?= =?us-ascii?q?YXvEjZHSL7mF/6gLKXe0gm4OSl6uDqbq3jppCGNo90jg/+Mr4pmsy6Gek5Mg?= =?us-ascii?q?kPX2iB9uS9yLHv4UP0Ta5XjvIqiKnVqo7VKtkGpqKhGQ9azp4j6wqjDzehyN?= =?us-ascii?q?kYmXgHLFRYeBOIloTpOE/BIOr+Dfihh1Shiylrx//YMb37GJnNLWbMkK3nfb?= =?us-ascii?q?lj705Q0g0zzcpQ58EcNrZUG//5U1TttdXeRiU0Mge0zuKvXM5n26sdVHiJD6?= =?us-ascii?q?vfN7nd5xvA4uMpPvnJfIo9pjnwMb4m6uTogHt/nkUSOeGt3J0KeDW7E+5gLk?= =?us-ascii?q?Gxf3XhmJECHH0Msw54S/blzBWwUT9CenD6ZqM14HlvGoKnHJrFX6imm/qc1z?= =?us-ascii?q?39E5FLMCQOIVCBF3j5as2/XPEDIHaZOchnnRQPTv68QJVn2B2z4lzU0b1ie9?= =?us-ascii?q?vV6C0FstrR1NF0r7nChxE79GQsVOyA2HvLQm1pyDBbDwQq1bxy9BQugmyI1r?= =?us-ascii?q?J11rkBTYRe?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2HfAgDGx5Zdh0WnVdFlDoVtM4RMjl6?= =?us-ascii?q?FFwGYGAEIAQEBDi8BAYcIIzgTAgMJAQEFAQEBAQEFBAEBAhABAQEIDQkIKYV?= =?us-ascii?q?AgjopAYNVEXwDDAImAiQSAQUBIgE0gwCCCwWhV4EDPIsmgTKIZgEJDYFIEno?= =?us-ascii?q?ojA6CF4Nuc4QogymCWASBNwEBAZUrllIBBgKCERQDjFGIRBuCKpcWLYwSgWy?= =?us-ascii?q?ZSg8jgUaBezMaJX8GZ4FPTxAUgWmNcVskkXsBAQ?= X-IPAS-Result: =?us-ascii?q?A2HfAgDGx5Zdh0WnVdFlDoVtM4RMjl6FFwGYGAEIAQEBD?= =?us-ascii?q?i8BAYcIIzgTAgMJAQEFAQEBAQEFBAEBAhABAQEIDQkIKYVAgjopAYNVEXwDD?= =?us-ascii?q?AImAiQSAQUBIgE0gwCCCwWhV4EDPIsmgTKIZgEJDYFIEnoojA6CF4Nuc4Qog?= =?us-ascii?q?ymCWASBNwEBAZUrllIBBgKCERQDjFGIRBuCKpcWLYwSgWyZSg8jgUaBezMaJ?= =?us-ascii?q?X8GZ4FPTxAUgWmNcVskkXsBAQ?= X-IronPort-AV: E=Sophos;i="5.67,254,1566889200"; d="scan'208";a="80143301" Received: from mail-lf1-f69.google.com ([209.85.167.69]) by smtpmx6.ucr.edu with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 03 Oct 2019 21:22:00 -0700 Received: by mail-lf1-f69.google.com with SMTP id o9so568727lfd.7 for ; Thu, 03 Oct 2019 21:21:59 -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:from:date:message-id:subject:to; bh=amG90aSOmtrR07i+DuzkZAUHX9myFv9sjojIkK2vdYg=; b=A/MH6PYUXEnPROxNfZfHwc053qZ0IgL7uGSWw8lsJ/wl7p4iMsMxWgVTkfVWykSilX fBZDBv2990dMButrvM0vZoK95PiCqBYAeZgWrMGX+iqOdcf/rxJH5ZcLnnHRyMJtq9c7 7SiAhJuW4Lry4Ue98P6qmbzPuw32CR5+X2HyXn1QauZLcewYhQ/zRwW0sopazF5qoESP ZccYBOn8+y8zKe9Ij9Wfe9xTla8Et38ycezlE71aS7xo6rlww/WYRjbyO0Q7BvRPL8E+ 4lTMAG0rMVnl2wfAR2+B81voGR/nY/3snNh/4RRXhS5OkSoReBBIUFDtg+ewhP6Pelhl QiHA== X-Gm-Message-State: APjAAAXOVnlq4eoluC7LC5LQWtSA/P0bajTgKqQLWP77mKf98i+JGiTw ivGV0/f68LkmregdDYnDhden0HkpXOFjCxedlboj/2/6DJoVqD70Mq7MokgF/q5QpFEaUI7lz8R Y9BxUgSseVyY+ehjUpDcW4RLMGnjOKUob+HOuH+GW0Q== X-Received: by 2002:a2e:89cd:: with SMTP id c13mr8095285ljk.92.1570162917779; Thu, 03 Oct 2019 21:21:57 -0700 (PDT) X-Received: by 2002:a2e:89cd:: with SMTP id c13mr8095273ljk.92.1570162917489; Thu, 03 Oct 2019 21:21:57 -0700 (PDT) MIME-Version: 1.0 From: Yizhuo Zhai Date: Thu, 3 Oct 2019 21:21:44 -0700 Message-ID: Subject: Potential uninitialized variables in power: supply: rt5033_battery: To: Sebastian Reichel , 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: 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. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside