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]
Date:	Sun, 09 Aug 2015 22:43:18 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	Woojung.Huh@...rochip.com
Cc:	netdev@...r.kernel.org, dan.carpenter@...cle.com
Subject: Re: [PATCH net-next 1/1] lan78xx: Fix Smatch warnings

From: <Woojung.Huh@...rochip.com>
Date: Wed, 5 Aug 2015 21:26:14 +0000

> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index ec8bd34..3ac405f 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -291,7 +291,7 @@ static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data)
>  	u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL);
>  	int ret;
>  
> -	BUG_ON(!dev);
> +	WARN_ON_ONCE(!dev);
>  

The debugging check makes no sense at all if you aren't going to crash
immediately due to it.

The subsequent dereference of dev will cause a crash anyways.

So if you're going to change this at all, just kill all of these
NULL pointer debug checks, as they are completely pointless.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ