This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] Fix uninitialized variable warning in __stp_call_mmap_callbacks_with_addr
- From: Wade Farnsworth <wade_farnsworth at mentor dot com>
- To: <systemtap at sourceware dot org>
- Date: Thu, 3 Nov 2011 11:10:26 -0700
- Subject: [PATCH] Fix uninitialized variable warning in __stp_call_mmap_callbacks_with_addr
When compiling a tapset, gcc complains that dentry may be used uninitialized in
this function. Initialize it to NULL to prevent this.
Signed-off-by: Wade Farnsworth <wade_farnsworth@mentor.com>
---
runtime/task_finder.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/runtime/task_finder.c b/runtime/task_finder.c
index 70d5ba1..6be9b07 100644
--- a/runtime/task_finder.c
+++ b/runtime/task_finder.c
@@ -678,7 +678,7 @@ __stp_call_mmap_callbacks_with_addr(struct stap_task_finder_target *tgt,
struct vm_area_struct *vma;
char *mmpath_buf = NULL;
char *mmpath = NULL;
- struct dentry *dentry;
+ struct dentry *dentry = NULL;
unsigned long length = 0;
unsigned long offset = 0;
unsigned long vm_flags = 0;
--
1.7.0.4