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: <20140910161337.GL667@saruman.home>
Date:	Wed, 10 Sep 2014 11:13:37 -0500
From:	Felipe Balbi <balbi@...com>
To:	Michal Nazarewicz <mina86@...a86.com>
CC:	Felipe Balbi <balbi@...com>,
	Dan Carpenter <dan.carpenter@...cle.com>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] usb: f_fs: replace BUG in dead-code with less
 serious WARN_ON

On Wed, Sep 10, 2014 at 05:50:25PM +0200, Michal Nazarewicz wrote:
> Even though the BUG() in __ffs_event_add is a dead-code, it is still
> better to warn rather then crash the system if that code ever gets
> executed.
> 
> Suggested-by: Felipe Balbi <balbi@...com>
> Signed-off-by: Michal Nazarewicz <mina86@...a86.com>
> ---
>  This has been compile tested only.
> 
>  drivers/usb/gadget/function/f_fs.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
> index ec50e0d..74d48b3 100644
> --- a/drivers/usb/gadget/function/f_fs.c
> +++ b/drivers/usb/gadget/function/f_fs.c
> @@ -2321,7 +2321,9 @@ static void __ffs_event_add(struct ffs_data *ffs,
>  		break;
>  
>  	default:
> -		BUG();
> +		pr_vdebug("%d: unknown event, this should not happen\n", type);
> +		WARN_ON(1);

WARN(1, "unknown event type %d\n", type);
Then you can drop pr_vdebug();

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ