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] [day] [month] [year] [list]
Message-ID: <447bfb17-e735-e700-0ff3-982b079cf865@redhat.com>
Date:   Sun, 19 Mar 2017 19:18:51 +0100
From:   Hans de Goede <hdegoede@...hat.com>
To:     kbuild test robot <lkp@...el.com>
Cc:     kbuild-all@...org, MyungJoo Ham <myungjoo.ham@...sung.com>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] extcon: Allow registering a single notifier for all
 cables on an extcon_dev

Hi,

On 19-03-17 14:06, kbuild test robot wrote:
> Hi Hans,
>
> [auto build test WARNING on chanwoo-extcon/extcon-next]
> [also build test WARNING on v4.11-rc2 next-20170310]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url:    https://github.com/0day-ci/linux/commits/Hans-de-Goede/extcon-Allow-registering-a-single-notifier-for-all-cables-on-an-extcon_dev/20170319-204610
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-next
> config: i386-randconfig-x072-201712 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386
>
> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>
> All warnings (new ones prefixed by >>):
>
>    drivers/extcon/extcon.c: In function 'extcon_unregister_notifier':
>>> drivers/extcon/extcon.c:962:48: warning: 'idx' may be used uninitialized in this function [-Wmaybe-uninitialized]
>       ret = raw_notifier_chain_unregister(&edev->nh[idx], nb);

I was already afraid this would happen, I was actually pleasantly surprised
when I did not get this warning during my own testing. But it seems other
compiler versions are not as smart as the very recent gcc I'm using.

I'll send a v2 fixing this.

Regards,

Hans




>                                                    ^
>
> vim +/idx +962 drivers/extcon/extcon.c
>
> 74c5d09b drivers/extcon/extcon_class.c Donggeun Kim  2012-04-20  946  				struct notifier_block *nb)
> 74c5d09b drivers/extcon/extcon_class.c Donggeun Kim  2012-04-20  947  {
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  948  	unsigned long flags;
> 046050f6 drivers/extcon/extcon.c       Chanwoo Choi  2015-05-19  949  	int ret, idx;
> 046050f6 drivers/extcon/extcon.c       Chanwoo Choi  2015-05-19  950
> 7eae43ae drivers/extcon/extcon.c       Chanwoo Choi  2015-06-21  951  	if (!edev || !nb)
> 7eae43ae drivers/extcon/extcon.c       Chanwoo Choi  2015-06-21  952  		return -EINVAL;
> 7eae43ae drivers/extcon/extcon.c       Chanwoo Choi  2015-06-21  953
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  954  	if ((int)id != -1) {
> 046050f6 drivers/extcon/extcon.c       Chanwoo Choi  2015-05-19  955  		idx = find_cable_index_by_id(edev, id);
> a05f44c8 drivers/extcon/extcon.c       Stephen Boyd  2016-06-23  956  		if (idx < 0)
> a05f44c8 drivers/extcon/extcon.c       Stephen Boyd  2016-06-23  957  			return idx;
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  958  	}
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  959
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  960  	spin_lock_irqsave(&edev->lock, flags);
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  961  	if ((int)id != -1)
> 046050f6 drivers/extcon/extcon.c       Chanwoo Choi  2015-05-19 @962  		ret = raw_notifier_chain_unregister(&edev->nh[idx], nb);
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  963  	else
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  964  		ret = raw_notifier_chain_unregister(&edev->nh_all, nb);
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  965
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  966  	spin_unlock_irqrestore(&edev->lock, flags);
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  967
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  968  	return ret;
> 74c5d09b drivers/extcon/extcon_class.c Donggeun Kim  2012-04-20  969  }
> 74c5d09b drivers/extcon/extcon_class.c Donggeun Kim  2012-04-20  970  EXPORT_SYMBOL_GPL(extcon_unregister_notifier);
>
> :::::: The code at line 962 was first introduced by commit
> :::::: 046050f6e623e442e9c71c525462ebd395dae526 extcon: Update the prototype of extcon_register_notifier() with enum extcon
>
> :::::: TO: Chanwoo Choi <cw00.choi@...sung.com>
> :::::: CC: Chanwoo Choi <cw00.choi@...sung.com>
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ