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]
Date:	Wed, 17 Dec 2014 17:35:21 -0500
From:	Murali Karicheri <m-karicheri2@...com>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
CC:	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	Christopher Li <sparse@...isli.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: How to fix CHECK warning: testing a 'safe expression' ?

On 12/17/2014 01:49 PM, Bjorn Helgaas wrote:
> [+cc Christopher, linux-kernel (this doesn't sound like a PCI-specific
> question)]
>
> On Wed, Dec 17, 2014 at 9:18 AM, Murali Karicheri<m-karicheri2@...com>  wrote:
>> I am trying to address CHECK warnings in my driver and wondering how to
>> resolve 'warning: testing a 'safe expression' which appears when using
>> IS_ERR_OR_NULL(foo)
>>
>> where foo is defined as
>>
>> struct foo_type *foo;
>>
>> The foo get assigned only NULL or ERR_PTR(error code). So I believe the
>> usage is correct. But then how do I make the CHECK happy of its usage?
>>
>> I have tried a grep to check on the current usage of IS_ERR_OR_NULL() and
>> found 276 of them causes this warning in the v3.18 version of the kernel
>> that I am using
>>
>> $ grep -r "warning: testing a 'safe expression" * | wc -l
>> 276
>>
>> Can someone help me undestand what this means and how to fix the same?
>>
>> I run folling for CHECK
>>
>> make C=2 CF="-D__CHECK_ENDIAN__" CHECK=sparse
>
> If you can share your actual code or point to it in the tree, you
> might get more specific help.
>
> Bjorn

For example I get

   CHECK   drivers/pci/host/pci-keystone.c
include/linux/err.h:40:16: warning: testing a 'safe expression'

Actually it is for IS_ERR_OR_NULL() call in the file which is the only
one call in the file.

-- 
Murali Karicheri
Linux Kernel, Texas Instruments
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ