Search Linux Wireless

Re: [PATCH] net: ath9k: use devm for request_irq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 31.07.24 23:02, Rosen Penev wrote:
Avoids having to manually call free_irq. Simplifies code slightly.

Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
  drivers/net/wireless/ath/ath9k/ahb.c | 7 ++-----
  drivers/net/wireless/ath/ath9k/pci.c | 9 +++------
  2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index 1a6697b6e3b4..29f67ded8fe2 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -118,7 +118,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
  	sc->mem = mem;
  	sc->irq = irq;
- ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc);
+	ret = devm_request_irq(&pdev->dev, irq, ath_isr, IRQF_SHARED, "ath9k", sc);
Sorry for the late response, but I think this patch is wrong any may need to be reverted. If there is an error during probe, and the IRQ fires for some reason, there could be an use-after-free bug when the IRQ handler accesses the data in sc.
The explicit freq_irq calls were preventing that from happening.

- Felix





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux