Skip to content

Commit 86a578e

Browse files
covanamKAGA-KOKO
authored andcommitted
wifi: rt2x00: Switch to use hrtimer_update_function()
The field 'function' of struct hrtimer should not be changed directly, as the write is lockless and a concurrent timer expiry might end up using the wrong function pointer. Switch to use hrtimer_update_function() which also performs runtime checks that it is safe to modify the callback. Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/82dcc0eae40bb84e6452f242751c0650e79bd87e.1738746927.git.namcao@linutronix.de
1 parent 3f8d93d commit 86a578e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/net/wireless/ralink/rt2x00/rt2800mmio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ int rt2800mmio_probe_hw(struct rt2x00_dev *rt2x00dev)
842842
/*
843843
* Set txstatus timer function.
844844
*/
845-
rt2x00dev->txstatus_timer.function = rt2800mmio_tx_sta_fifo_timeout;
845+
hrtimer_update_function(&rt2x00dev->txstatus_timer, rt2800mmio_tx_sta_fifo_timeout);
846846

847847
/*
848848
* Overwrite TX done handler

drivers/net/wireless/ralink/rt2x00/rt2800usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev)
618618
/*
619619
* Set txstatus timer function.
620620
*/
621-
rt2x00dev->txstatus_timer.function = rt2800usb_tx_sta_fifo_timeout;
621+
hrtimer_update_function(&rt2x00dev->txstatus_timer, rt2800usb_tx_sta_fifo_timeout);
622622

623623
/*
624624
* Overwrite TX done handler

0 commit comments

Comments
 (0)