lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 24 Oct 2017 08:35:21 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Takashi Iwai <tiwai@...e.de>
Cc:     Jaroslav Kysela <perex@...ex.cz>,
        David Howells <dhowells@...hat.com>,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: [PATCH] sound: oss: waveartist: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Jaroslav Kysela <perex@...ex.cz>
Cc: Takashi Iwai <tiwai@...e.com>
Cc: David Howells <dhowells@...hat.com>
Cc: alsa-devel@...a-project.org
Signed-off-by: Kees Cook <keescook@...omium.org>
---
 sound/oss/waveartist.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c
index 4f0c3a232e41..c051c8e6023e 100644
--- a/sound/oss/waveartist.c
+++ b/sound/oss/waveartist.c
@@ -151,6 +151,7 @@ static DEFINE_SPINLOCK(waveartist_lock);
 #define machine_is_netwinder() 0
 #else
 static struct timer_list vnc_timer;
+static int timer_nr_waveartist_devs;
 static void vnc_configure_mixer(struct wavnc_info *devc,
 				unsigned int input_mask);
 static int vnc_private_ioctl(int dev, unsigned int cmd, int __user *arg);
@@ -1414,8 +1415,8 @@ attach_waveartist(struct address_info *hw, const struct waveartist_mixer_info *m
 	else {
 #ifdef CONFIG_ARCH_NETWINDER
 		if (machine_is_netwinder()) {
-			setup_timer(&vnc_timer, vnc_slider_tick,
-				    nr_waveartist_devs);
+			timer_nr_waveartist_devs = nr_waveartist_devs;
+			timer_setup(&vnc_timer, vnc_slider_tick, 0);
 			mod_timer(&vnc_timer, jiffies);
 
 			vnc_configure_mixer(devc, 0);
@@ -1799,11 +1800,11 @@ vnc_slider(struct wavnc_info *devc)
 }
 
 static void
-vnc_slider_tick(unsigned long data)
+vnc_slider_tick(struct timer_list *unused)
 {
 	int next_timeout;
 
-	if (vnc_slider(adev_info + data))
+	if (vnc_slider(adev_info + timer_nr_waveartist_devs))
 		next_timeout = 5;	// mixer reported change
 	else
 		next_timeout = VNC_TIMER_PERIOD;
-- 
2.7.4


-- 
Kees Cook
Pixel Security

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ