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:	Thu, 10 May 2012 14:39:20 -0700
From:	Greg KH <gregkh@...uxfoundation.org>
To:	Tim Bird <tim.bird@...sony.com>
Cc:	Brian Swetland <swetland@...gle.com>,
	linux kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] staging: android: logger: Allocate logs dynamically
 at boot (v2)

On Thu, May 10, 2012 at 02:29:26PM -0700, Tim Bird wrote:
> On 05/10/2012 02:21 PM, Greg KH wrote:
> > On Thu, May 10, 2012 at 02:16:31PM -0700, Tim Bird wrote:
> >> +	log->misc.minor = MISC_DYNAMIC_MINOR;
> >> +	log->misc.name = kstrdup(log_name, GFP_KERNEL);
> >> +	if (log->misc.name == NULL) {
> >> +		ret = -1;
> >> +		goto out_free_log;
> > 
> > Please return a "real" error number, not just -1.  You do this a few
> > times in this function, -EINVAL perhaps?  -1 is -EPERM, which is not
> > what you want to be saying here, right?
> 
> You're right.  This is only called by init code now, which doesn't
> look at the return value (only checks for non-zero), but the intent
> is to change this going forward, so a real error number is called for.
> 
> These are all memory allocation failures, so I'm thinking of using
> -ENOMEM.  Would that be right?

Yes, sorry, I missed that, -ENOMEM is correct

I was looking at the place where the lookup failed to find the log
specified, you should return a proper error for that as well.

thanks,

greg k-h
--
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