kasan: don't duplicate config dependencies
[linux-2.6-microblaze.git] / lib / dynamic_debug.c
index bd7b3aa..c70d634 100644 (file)
@@ -561,9 +561,14 @@ static int ddebug_exec_queries(char *query, const char *modname)
 int dynamic_debug_exec_queries(const char *query, const char *modname)
 {
        int rc;
-       char *qry = kstrndup(query, PAGE_SIZE, GFP_KERNEL);
+       char *qry; /* writable copy of query */
 
-       if (!query)
+       if (!query) {
+               pr_err("non-null query/command string expected\n");
+               return -EINVAL;
+       }
+       qry = kstrndup(query, PAGE_SIZE, GFP_KERNEL);
+       if (!qry)
                return -ENOMEM;
 
        rc = ddebug_exec_queries(qry, modname);