diff options
| author | Mark Brown <broonie@kernel.org> | 2020-12-28 14:16:53 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2020-12-28 14:16:53 +0000 |
| commit | f81325a05e9317f09a2e4ec57a52e4e49eb42b54 (patch) | |
| tree | a5a91589c9ef8e212f2899f1462cfb5c3f0130ef /lib/dynamic_debug.c | |
| parent | 671ee4db952449acde126965bf76817a3159040d (diff) | |
| parent | 5c8fe583cce542aa0b84adc939ce85293de36e5e (diff) | |
Merge tag 'v5.11-rc1' into asoc-5.11
Linux 5.11-rc1
Diffstat (limited to 'lib/dynamic_debug.c')
| -rw-r--r-- | lib/dynamic_debug.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index bd7b3aaa93c3..c70d6347afa2 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -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); |
