summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunyu Xiao <runyu.xiao@seu.edu.cn>2026-08-30 22:30:02 +0800
committerHans Verkuil <hverkuil+cisco@kernel.org>2026-09-08 15:10:04 +0200
commite07c75a6bc4adf1ed09ede31756261e2c6bdede5 (patch)
tree817e419b040761fdb70ce156243f17c28040a08a
parent702eb8bc6d5fc2d921de8765da13380e6b880f49 (diff)
downloadlinux-next-e07c75a6bc4adf1ed09ede31756261e2c6bdede5.tar.gz
linux-next-e07c75a6bc4adf1ed09ede31756261e2c6bdede5.zip
media: saa7146: Initialize interrupt lock before requesting IRQ
The saa7146 interrupt handler can call SAA7146_IER_DISABLE(), which serializes register access with dev->int_slock. request_irq() allows the shared handler to run before saa7146_init_one() reaches the current lock initialization block. Initialize dev->int_slock before requesting the interrupt so every handler path sees an initialized lock. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Assisted-by: Codex:GPT-5 Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
-rw-r--r--drivers/media/common/saa7146/saa7146_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/common/saa7146/saa7146_core.c b/drivers/media/common/saa7146/saa7146_core.c
index c297d019f2b3..70d6ca00513f 100644
--- a/drivers/media/common/saa7146/saa7146_core.c
+++ b/drivers/media/common/saa7146/saa7146_core.c
@@ -340,6 +340,8 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
goto out;
}
+ spin_lock_init(&dev->int_slock);
+
/* create a nice device name */
sprintf(dev->name, "saa7146 (%d)", saa7146_num);
@@ -425,7 +427,6 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
dev->ext = ext;
mutex_init(&dev->v4l2_lock);
- spin_lock_init(&dev->int_slock);
spin_lock_init(&dev->slock);
mutex_init(&dev->i2c_lock);