diff options
author | Soeren Sandmann <sandmann@redhat.com> | 2006-01-14 04:00:59 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2006-01-14 04:00:59 +0000 |
commit | 2d525523f85341ee39ed419a2a1c720672d968ab (patch) | |
tree | b4f16a567d0b63b534bee076d7f8fd35029853fa /module | |
parent | c65bfcc1142e78a9bf8190f6a6558b1ed3a71cb9 (diff) |
Initialize retval.
Fri Jan 13 22:59:48 2006 Soeren Sandmann <sandmann@redhat.com>
* module/sysprof-module.c (sysprof_open): Initialize retval.
* module/sysprof-module.c (sysprof_read): Copy contents of trace,
not tail to the buffer.
Diffstat (limited to 'module')
-rw-r--r-- | module/sysprof-module.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/module/sysprof-module.c b/module/sysprof-module.c index 58507e8..eb4a4b4 100644 --- a/module/sysprof-module.c +++ b/module/sysprof-module.c @@ -175,8 +175,10 @@ sysprof_read(struct file *file, char *buffer, size_t count, loff_t *offset) trace = tail; if (tail++ == &stack_traces[N_TRACES - 1]) tail = &stack_traces[0]; + + BUG_ON(trace->pid == 0); - if (copy_to_user(buffer, tail, sizeof *tail)) + if (copy_to_user(buffer, trace, sizeof *trace)) return -EFAULT; file->private_data = tail; @@ -203,7 +205,7 @@ sysprof_poll(struct file *file, poll_table *poll_table) static int sysprof_open(struct inode *inode, struct file *file) { - int retval; + int retval = 0; if (atomic_inc_return(&client_count) == 1) retval = register_timer_hook (timer_notify); |