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.
This commit is contained in:
Soeren Sandmann
2006-01-14 04:00:59 +00:00
committed by Søren Sandmann Pedersen
parent c65bfcc114
commit 2d525523f8
3 changed files with 12 additions and 3 deletions

View File

@ -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);