Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09c9feb9 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds
Browse files

Documentation: make configfs example code simpler, clearer



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: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarJoel Becker <joel.becker@oracle.com>
Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2b35f4d9
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -89,7 +89,7 @@ static ssize_t childless_storeme_write(struct childless *childless,
	char *p = (char *) page;
	char *p = (char *) page;


	tmp = simple_strtoul(p, &p, 10);
	tmp = simple_strtoul(p, &p, 10);
	if (!p || (*p && (*p != '\n')))
	if ((*p != '\0') && (*p != '\n'))
		return -EINVAL;
		return -EINVAL;


	if (tmp > INT_MAX)
	if (tmp > INT_MAX)