Use of strict_strtoul() instead of simple_strtoul() as suggested by checkpatch. Other...
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 22 Oct 2009 12:58:55 +0000 (12:58 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 22 Oct 2009 12:58:55 +0000 (12:58 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1241 d57e44dd-8a1f-0410-8b47-8ef2f437770f

scst/src/scst_sysfs.c

index d9a1f13..57aadd4 100644 (file)
@@ -1342,7 +1342,12 @@ static int scst_write_trace(const char *buf, size_t length,
        case SCST_TRACE_ACTION_VALUE:
                while (isspace(*p) && *p != '\0')
                        p++;
-               level = simple_strtoul(p, NULL, 0);
+               res = strict_strtoul(p, 0, &level);
+               if (res != 0) {
+                       PRINT_ERROR("Invalud trace value \"%s\"", p);
+                       res = -EINVAL;
+                       goto out_free;
+               }
                break;
        }