Skip to content

Commit

Permalink
[PATCH] hpet: fix uninitialized variable in hpet_register()
Browse files Browse the repository at this point in the history
Clear the ht_opaque field in the hpet_register() function before searching for
a free timer to prevent the function from incorrectly assuming that the search
succeeded afterwards.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: Bob Picco <bob.picco@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Clemens Ladisch authored and Linus Torvalds committed Oct 31, 2005
1 parent af95ead commit 7522e4e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/char/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ int hpet_register(struct hpet_task *tp, int periodic)
return -EINVAL;
}

tp->ht_opaque = NULL;

spin_lock_irq(&hpet_task_lock);
spin_lock(&hpet_lock);

Expand Down

0 comments on commit 7522e4e

Please sign in to comment.