From: Tim Bird <tim.bird@am.sony.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Brian Swetland <swetland@google.com>,
linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] staging: android: logger: Allocate logs dynamically at boot (v2)
Date: Thu, 10 May 2012 14:29:26 -0700 [thread overview]
Message-ID: <4FAC3336.3010609@am.sony.com> (raw)
In-Reply-To: <20120510212122.GA16432@kroah.com>
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?
-- Tim
=============================
Tim Bird
Architecture Group Chair, CE Workgroup of the Linux Foundation
Senior Staff Engineer, Sony Network Entertainment
=============================
next prev parent reply other threads:[~2012-05-10 21:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-10 21:16 [PATCH 1/2] staging: android: logger: Allocate logs dynamically at boot (v2) Tim Bird
2012-05-10 21:21 ` Greg KH
2012-05-10 21:29 ` Tim Bird [this message]
2012-05-10 21:39 ` Greg KH
2012-05-10 22:11 ` [PATCH 1/2] staging: android: logger: Allocate logs dynamically at boot (v3) Tim Bird
2012-05-10 21:22 ` [PATCH 2/2] staging: android: logger: Fix some sparse and whitespace issues Tim Bird
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FAC3336.3010609@am.sony.com \
--to=tim.bird@am.sony.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=swetland@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox