All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: outreachy-kernel@googlegroups.com
Cc: Shivani Bhardwaj <shivanib134@gmail.com>
Subject: Re: [Outreachy kernel] [PATCH v2] Staging: lustre: lpoc_osc:  Change the variable to be checked
Date: Fri, 16 Oct 2015 10:41:05 +0200	[thread overview]
Message-ID: <4275207.TTHHeQE8pW@wuerfel> (raw)
In-Reply-To: <20151016083218.GA2815@ubuntu>

On Friday 16 October 2015 14:02:18 Shivani Bhardwaj wrote:
> index 053d508..cdc7f88 100644
> --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c
> +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c
> @@ -61,9 +61,7 @@ static ssize_t active_store(struct kobject *kobj, struct attribute *attr,
>         unsigned long val;
>  
>         rc = kstrtoul(buffer, 10, &val);
> -       if (rc)
> -               return rc;
> -       if (val < 0 || val > 1)
> +       if (rc < 0)
>                 return -ERANGE;
>  
>         /* opposite senses */
> -- 
> 

I believe the intention of the code is to return -ERANGE if anything other
than 0 or 1 is stored here, which no longer works after your patch. The
range check in kstrtoul only ensures that there is a number that fits within
an 'unsigned long'.

	Arnd


  reply	other threads:[~2015-10-16  8:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16  8:32 [PATCH v2] Staging: lustre: lpoc_osc: Change the variable to be checked Shivani Bhardwaj
2015-10-16  8:41 ` Arnd Bergmann [this message]
2015-10-16  8:57   ` [Outreachy kernel] " Shivani Bhardwaj
2015-10-16  9:55     ` Arnd Bergmann
2015-10-16 11:02       ` Shivani Bhardwaj
2015-10-18 10:31         ` Shivani Bhardwaj
2015-10-18 12:54           ` Arnd Bergmann
2015-10-18 13:02             ` Shivani Bhardwaj
2015-10-18 13:12               ` Arnd Bergmann
2015-10-18 13:14                 ` Shivani Bhardwaj

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=4275207.TTHHeQE8pW@wuerfel \
    --to=arnd@arndb.de \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=shivanib134@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.