public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Ayman Bagabas <ayman.bagabas@gmail.com>
Cc: kbuild-all@01.org, Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Sinan Kaya <okaya@kernel.org>, Takashi Iwai <tiwai@suse.de>,
	Ayman Bagabas <ayman.bagabas@gmail.com>,
	Stuart Hayes <stuart.w.hayes@gmail.com>,
	Matan Ziv-Av <matan@svgalib.org>,
	"Enrico Weigelt, metux IT consult" <info@metux.net>,
	Hans de Goede <hdegoede@redhat.com>,
	Peng Hao <peng.hao2@zte.com.cn>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Mattias Jacobsson <2pi@mok.nu>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 4/6] platform/x86: huawei-wmi: Add battery charging thresholds
Date: Mon, 23 Sep 2019 14:06:43 +0800	[thread overview]
Message-ID: <20190923060643.GE15734@shao2-debian> (raw)
In-Reply-To: <20190920160250.12510-5-ayman.bagabas@gmail.com>

Hi Ayman,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on next-20190918]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Ayman-Bagabas/platform-x86-Huawei-WMI-laptop-extras-driver/20190921-072831
base:   next-20190918
:::::: branch date: 31 hours ago
:::::: commit date: 31 hours ago

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

smatch warnings:
drivers/platform/x86/huawei-wmi.c:327 huawei_wmi_battery_get() error: buffer overflow 'ret' 256 <= 256

# https://github.com/0day-ci/linux/commit/2b04f79aef9a86ecb9483dd27a82498fa56bc0c9
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 2b04f79aef9a86ecb9483dd27a82498fa56bc0c9
vim +/ret +327 drivers/platform/x86/huawei-wmi.c

2b04f79aef9a86 Ayman Bagabas 2019-09-20  311  
2b04f79aef9a86 Ayman Bagabas 2019-09-20  312  static int huawei_wmi_battery_get(int *start, int *end)
2b04f79aef9a86 Ayman Bagabas 2019-09-20  313  {
2b04f79aef9a86 Ayman Bagabas 2019-09-20  314  	u8 ret[0x100];
2b04f79aef9a86 Ayman Bagabas 2019-09-20  315  	int err, i;
2b04f79aef9a86 Ayman Bagabas 2019-09-20  316  
2b04f79aef9a86 Ayman Bagabas 2019-09-20  317  	err = huawei_wmi_cmd(BATTERY_THRESH_GET, ret, 0x100);
2b04f79aef9a86 Ayman Bagabas 2019-09-20  318  	if (err)
2b04f79aef9a86 Ayman Bagabas 2019-09-20  319  		return err;
2b04f79aef9a86 Ayman Bagabas 2019-09-20  320  
2b04f79aef9a86 Ayman Bagabas 2019-09-20  321  	/* Find the last two non-zero values. Return status is ignored. */
2b04f79aef9a86 Ayman Bagabas 2019-09-20  322  	i = 0x100;
2b04f79aef9a86 Ayman Bagabas 2019-09-20  323  	do {
2b04f79aef9a86 Ayman Bagabas 2019-09-20  324  		if (start)
2b04f79aef9a86 Ayman Bagabas 2019-09-20  325  			*start = ret[i-1];
2b04f79aef9a86 Ayman Bagabas 2019-09-20  326  		if (end)
2b04f79aef9a86 Ayman Bagabas 2019-09-20 @327  			*end = ret[i];
2b04f79aef9a86 Ayman Bagabas 2019-09-20  328  	} while (i > 2 && !ret[i--]);
2b04f79aef9a86 Ayman Bagabas 2019-09-20  329  
2b04f79aef9a86 Ayman Bagabas 2019-09-20  330  	return 0;
2b04f79aef9a86 Ayman Bagabas 2019-09-20  331  }
2b04f79aef9a86 Ayman Bagabas 2019-09-20  332  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

  reply	other threads:[~2019-09-23  6:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20 16:02 [PATCH v4 0/6] platform/x86: Huawei WMI laptop extras driver Ayman Bagabas
2019-09-20 16:02 ` [PATCH v4 1/6] platform/x86: huawei-wmi: Move to platform driver Ayman Bagabas
2019-09-20 16:02 ` [PATCH v4 2/6] platform/x86: huawei-wmi: Add quirks and module parameters Ayman Bagabas
2019-09-20 16:02 ` [PATCH v4 3/6] platform/x86: huawei-wmi: Implement huawei wmi management Ayman Bagabas
2019-09-20 16:02 ` [PATCH v4 4/6] platform/x86: huawei-wmi: Add battery charging thresholds Ayman Bagabas
2019-09-23  6:06   ` kbuild test robot [this message]
2019-09-20 16:02 ` [PATCH v4 5/6] platform/x86: huawei-wmi: Add fn-lock support Ayman Bagabas
2019-09-20 16:02 ` [PATCH v4 6/6] platform/x86: huawei-wmi: Add debugfs support Ayman Bagabas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190923060643.GE15734@shao2-debian \
    --to=lkp@intel.com \
    --cc=2pi@mok.nu \
    --cc=andy@infradead.org \
    --cc=ayman.bagabas@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=hdegoede@redhat.com \
    --cc=info@metux.net \
    --cc=kbuild-all@01.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matan@svgalib.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=okaya@kernel.org \
    --cc=peng.hao2@zte.com.cn \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stuart.w.hayes@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox