diff options
Diffstat (limited to 'kernel/trace/trace_uprobe.c')
-rw-r--r-- | kernel/trace/trace_uprobe.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index c86e6d4f67fb..87b6db4ccbc5 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c | |||
@@ -258,6 +258,10 @@ static int create_trace_uprobe(int argc, char **argv) | |||
258 | goto fail_address_parse; | 258 | goto fail_address_parse; |
259 | 259 | ||
260 | inode = igrab(path.dentry->d_inode); | 260 | inode = igrab(path.dentry->d_inode); |
261 | if (!S_ISREG(inode->i_mode)) { | ||
262 | ret = -EINVAL; | ||
263 | goto fail_address_parse; | ||
264 | } | ||
261 | 265 | ||
262 | argc -= 2; | 266 | argc -= 2; |
263 | argv += 2; | 267 | argv += 2; |
@@ -356,7 +360,7 @@ fail_address_parse: | |||
356 | if (inode) | 360 | if (inode) |
357 | iput(inode); | 361 | iput(inode); |
358 | 362 | ||
359 | pr_info("Failed to parse address.\n"); | 363 | pr_info("Failed to parse address or file.\n"); |
360 | 364 | ||
361 | return ret; | 365 | return ret; |
362 | } | 366 | } |