public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: Joe Perches <joe@perches.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	"a.p.zijlstra@chello.nl" <a.p.zijlstra@chello.nl>,
	Mel Gorman <mgorman@suse.de>,
	riel@redhat.com, Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] kernel/sysctl.c: check return value after call proc_put_char() in __do_proc_doulongvec_minmax()
Date: Tue, 20 Aug 2013 13:17:53 +0800	[thread overview]
Message-ID: <5212FC01.80607@asianux.com> (raw)
In-Reply-To: <1376975340.2016.42.camel@joe-AO722>

On 08/20/2013 01:09 PM, Joe Perches wrote:
> On Tue, 2013-08-20 at 11:38 +0800, Chen Gang wrote:
>> Need check the return value of proc_put_char(), just like another have
>> done in __do_proc_doulongvec_minmax().
>>
>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> ---
>>  kernel/sysctl.c |    5 ++++-
>>  1 files changed, 4 insertions(+), 1 deletions(-)
>>
>> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
>> index 7822cd8..ee00986 100644
>> --- a/kernel/sysctl.c
>> +++ b/kernel/sysctl.c
>> @@ -2214,8 +2214,11 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
>>  			*i = val;
>>  		} else {
>>  			val = convdiv * (*i) / convmul;
>> -			if (!first)
>> +			if (!first) {
>>  				err = proc_put_char(&buffer, &left, '\t');
>> +				if (err)
>> +					goto free;
>> +			}
> 
> I think you should use break and convert it in
> to goto free in patch 2/2.
> 
> Otherwise, this style looks out of place.
> 

Hmm... It sounds reasonable to me, if necessary, I will send patch v2
for them (no reply means not need send patch v2, this time).

Thanks.

>>  			err = proc_put_long(&buffer, &left, val, false);
>>  			if (err)
>>  				break;
> 
> 
> 
> 
> 


-- 
Chen Gang

  reply	other threads:[~2013-08-20  5:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-20  3:37 [PATCH 0/2] kernel/sysctl.c: about the return value after fail call Chen Gang
2013-08-20  3:38 ` [PATCH 1/2] kernel/sysctl.c: check return value after call proc_put_char() in __do_proc_doulongvec_minmax() Chen Gang
2013-08-20  3:39   ` [PATCH 2/2] kernel/sysctl.c: simplify code for C code readers Chen Gang
2013-08-20  5:09   ` [PATCH 1/2] kernel/sysctl.c: check return value after call proc_put_char() in __do_proc_doulongvec_minmax() Joe Perches
2013-08-20  5:17     ` Chen Gang [this message]
2013-09-03  5:16       ` [PATCH] " Chen Gang

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=5212FC01.80607@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=riel@redhat.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