From: Clemens Ladisch Date: Sun, 30 Oct 2005 23:03:39 +0000 (-0800) Subject: [PATCH] hpet: fix uninitialized variable in hpet_register() X-Git-Tag: v2.6.15-rc1~59^2~15^2~17 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7522e4ecdfdf86b9816f06d55766a6f88baa0348;p=linux-2.6 [PATCH] hpet: fix uninitialized variable in hpet_register() 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 Cc: Bob Picco Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index bc5ee99b9c..73e6614cdf 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -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);