lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <43f05051-b1ad-88a9-abea-2111fbc2be94@collabora.com>
Date:   Thu, 29 Nov 2018 15:43:14 +0100
From:   Enric Balletbo i Serra <enric.balletbo@...labora.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>, kbuild@...org
Cc:     kbuild-all@...org, lee.jones@...aro.org, gwendal@...omium.org,
        drinkcat@...omium.org, linux-kernel@...r.kernel.org,
        groeck@...omium.org, kernel@...labora.com, bleung@...omium.org,
        Olof Johansson <olof@...om.net>
Subject: Re: [PATCH 5/7] mfd / platform: cros_ec: move device sysfs attributes
 to its own driver.

Hi Dan,

On 29/11/18 12:21, Dan Carpenter wrote:
> Hi Enric,
> 
> I love your patch! Perhaps something to improve:
> 
> url:    https://github.com/0day-ci/linux/commits/Enric-Balletbo-i-Serra/mfd-cros_ec-use-devm_mfd_add_devices/20181123-025253
> 
> smatch warnings:
> drivers/platform/chrome/cros_ec_sysfs.c:366 cros_ec_sysfs_probe() warn: variable dereferenced before check 'ec_dev' (see line 362)
> 
> # https://github.com/0day-ci/linux/commit/b3074e331f36fff8890e7bd5c1f5874f4c59d38f
> git remote add linux-review https://github.com/0day-ci/linux
> git remote update linux-review
> git checkout b3074e331f36fff8890e7bd5c1f5874f4c59d38f
> vim +/ec_dev +366 drivers/platform/chrome/cros_ec_sysfs.c
> 
> b3074e33 Enric Balletbo i Serra 2018-11-22  358  
> b3074e33 Enric Balletbo i Serra 2018-11-22  359  static int cros_ec_sysfs_probe(struct platform_device *pd)
> b3074e33 Enric Balletbo i Serra 2018-11-22  360  {
> b3074e33 Enric Balletbo i Serra 2018-11-22  361  	struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent);
> b3074e33 Enric Balletbo i Serra 2018-11-22 @362  	struct cros_ec_platform *ec_platform = dev_get_platdata(ec_dev->dev);
>                                                                                                                 ^^^^^^^^^^^
> b3074e33 Enric Balletbo i Serra 2018-11-22  363  	struct device *dev = &pd->dev;
> b3074e33 Enric Balletbo i Serra 2018-11-22  364  	int ret;
> b3074e33 Enric Balletbo i Serra 2018-11-22  365  
> b3074e33 Enric Balletbo i Serra 2018-11-22 @366  	if (!ec_dev) {
>                                                              ^^^^^^
> Presumable this test can be removed?
> 

Yes, Guenter detected this and I already sent another patchset that removes
this. Thanks.

> b3074e33 Enric Balletbo i Serra 2018-11-22  367  		dev_err(dev, "No EC dev found\n");
> b3074e33 Enric Balletbo i Serra 2018-11-22  368  		return -EINVAL;
> b3074e33 Enric Balletbo i Serra 2018-11-22  369  	}
> b3074e33 Enric Balletbo i Serra 2018-11-22  370  
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 

I had this question on my mind for some time but I didn't look for an answer, in
fact, I'm not sure if I already asked you this before, sorry about that if I
did, the question is. There is a easy way to run your smatch scripts locally to
check the patch before I send to the ML?

Best regards,
 Enric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ