All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@xenotime.net>
To: linux-kernel@vger.kernel.org
Cc: Dan Carpenter <error27@gmail.com>
Cc: Joel Becker <joel.becker@oracle.com>
Subject: [PATCH 2/8] Documentation: make configfs example code simpler, clearer
Date: Wed, 10 Nov 2010 11:53:50 -0800	[thread overview]
Message-ID: <12894188301399@xenotime.net> (raw)
In-Reply-To: <1289418830794@xenotime.net>

From: Dan Carpenter <error27@gmail.com>

If "p" is NULL then it will cause an oops when we pass it to
simple_strtoul().  In this case "p" can not be NULL so I removed the
check.  I also changed the check a little to make it more explicit that
we are testing whether p points to the NUL char.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
V2: Added some parenthesis to make the precedence more clear.

---
 Documentation/filesystems/configfs/configfs_example_explicit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.37-rc1-git8.orig/Documentation/filesystems/configfs/configfs_example_explicit.c
+++ linux-2.6.37-rc1-git8/Documentation/filesystems/configfs/configfs_example_explicit.c
@@ -89,7 +89,7 @@ static ssize_t childless_storeme_write(s
 	char *p = (char *) page;
 
 	tmp = simple_strtoul(p, &p, 10);
-	if (!p || (*p && (*p != '\n')))
+	if ((*p != '\0') && (*p != '\n'))
 		return -EINVAL;
 
 	if (tmp > INT_MAX)


-- 


  parent reply	other threads:[~2010-11-10 22:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10 19:53 [for review: PATCH 1/8] kernel-doc: escape xml for structs Randy Dunlap
2010-11-10 19:53 ` [PATCH 5/8] Documentation/development-process: use -next trees instead of staging Randy Dunlap
2010-11-10 19:53 ` [PATCH 4/8] Documentation: change email address for Hans Koch Randy Dunlap
2010-11-10 19:53 ` [PATCH 8/8] MAINTAINERS: update documentation entries Randy Dunlap
2010-11-10 19:53 ` [PATCH 6/8] Documentation/development-process: more staging info Randy Dunlap
2010-11-10 19:53 ` [PATCH 7/8] Documentation: remove anticipatory scheduler info Randy Dunlap
2010-11-11 11:10   ` Jens Axboe
2010-11-10 19:53 ` Randy Dunlap [this message]
2010-11-10 19:53 ` [PATCH 3/8] Documentation/gpio.txt: explain poll/select usage Randy Dunlap

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=12894188301399@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=error27@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.