From b665918dea92b2c3818be694cafb976390e31377 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 22 Oct 2009 12:58:55 +0000 Subject: [PATCH] Use of strict_strtoul() instead of simple_strtoul() as suggested by checkpatch. Other uses of simple_strtoul() are OK and can't be converted git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1241 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_sysfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index d9a1f13ec..57aadd4f0 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -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; }