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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1373386794.14604.14.camel@joe-AO722>
Date:	Tue, 09 Jul 2013 09:19:54 -0700
From:	Joe Perches <joe@...ches.com>
To:	Jean Delvare <jdelvare@...e.de>
Cc:	linux-kernel@...r.kernel.org, Ben Hutchings <ben@...adent.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/3] firmware/dmi_scan: Fix most checkpatch errors and
 warnings

On Tue, 2013-07-09 at 17:42 +0200, Jean Delvare wrote:
> Fix all errors and trivial warnings reported by checkpatch for file
> drivers/firmware/dmi_scan.c.

trivia:

> +++ linux-3.11-rc0/drivers/firmware/dmi_scan.c	2013-07-09 16:08:13.979592957 +0200
> @@ -63,7 +63,7 @@ static char * __init dmi_string(const st
>  	if (str != NULL)
>  		strcpy(str, bp);
>  	else
> -		printk(KERN_ERR "dmi_string: cannot allocate %Zu bytes.\n", len);
> +		pr_err("dmi_string: cannot allocate %Zu bytes.\n", len);

If the function name is used in every printk, it might
be better to add

#define pr_fmt(fmt) "%s: " fmt, __func__

before any #include

If not, then I suggest removing the embedded function names
and writing these as
		pr_err("%s: etc...", __func__, etc...);

This eliminates any possible function name mismatch.

> @@ -217,7 +220,7 @@ static void __init dmi_save_one_device(i
>  
>  	dev = dmi_alloc(sizeof(*dev) + strlen(name) + 1);
>  	if (!dev) {
> -		printk(KERN_ERR "dmi_save_one_device: out of memory.\n");
> +		pr_err("dmi_save_one_device: out of memory.\n");

OOM messages generally aren't useful.

dmi_alloc is either a trivial front-end to kmalloc,
and kmalloc already does a dump_stack() when OOM, or
for x86, dmi_alloc uses extend_brk which BUGs when
unsuccessful.

x86/ia64 do have a slight mismatch in dmi_alloc as
x86 does a memset(0), and ia64 just does kmalloc.


--
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