소스 검색

dynamic_debug: small cleanup in ddebug_proc_write()

This doesn't change behavior at all.  In the original code, if nwords was
zero then ddebug_parse_query() would return -EINVAL, now we just do it
earlier.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Dan Carpenter 15 년 전
부모
커밋
ea46c8f774
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/dynamic_debug.c

+ 1 - 1
lib/dynamic_debug.c

@@ -456,7 +456,7 @@ static ssize_t ddebug_proc_write(struct file *file, const char __user *ubuf,
 			__func__, (int)len);
 			__func__, (int)len);
 
 
 	nwords = ddebug_tokenize(tmpbuf, words, MAXWORDS);
 	nwords = ddebug_tokenize(tmpbuf, words, MAXWORDS);
-	if (nwords < 0)
+	if (nwords <= 0)
 		return -EINVAL;
 		return -EINVAL;
 	if (ddebug_parse_query(words, nwords-1, &query))
 	if (ddebug_parse_query(words, nwords-1, &query))
 		return -EINVAL;
 		return -EINVAL;