Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 1/1] counter: intel-qep: Use devm_mutex_init()
@ 2026-05-20 11:18 Ilpo Järvinen
  2026-05-20 11:41 ` Stepan Ionichev
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ilpo Järvinen @ 2026-05-20 11:18 UTC (permalink / raw)
  To: Ilpo Järvinen, William Breathitt Gray, Jonathan Cameron,
	Raymond Tan, Felipe Balbi (Intel), linux-iio, linux-kernel
  Cc: stable

intel_qep_probe() calls mutex_init() but lacks the pairing
mutex_destroy() calls. Convert to devm_mutex_init() which handles
cleanup automatically.

Fixes: b711f687a1c1 ("counter: Add support for Intel Quadrature Encoder Peripheral")
Cc: stable@vger.kernel.org
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/counter/intel-qep.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/counter/intel-qep.c b/drivers/counter/intel-qep.c
index c49c178056f4..816586893517 100644
--- a/drivers/counter/intel-qep.c
+++ b/drivers/counter/intel-qep.c
@@ -414,7 +414,9 @@ static int intel_qep_probe(struct pci_dev *pci, const struct pci_device_id *id)
 
 	qep->dev = dev;
 	qep->regs = regs;
-	mutex_init(&qep->lock);
+	ret = devm_mutex_init(dev, &qep->lock);
+	if (ret)
+		return ret;
 
 	intel_qep_init(qep);
 	pci_set_drvdata(pci, qep);

base-commit: 1d5dcaa3bd65f2e8c9baa14a393d3a2dc5db7524
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-29  2:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20 11:18 [PATCH 1/1] counter: intel-qep: Use devm_mutex_init() Ilpo Järvinen
2026-05-20 11:41 ` Stepan Ionichev
2026-05-20 11:42 ` Joshua Crofts
2026-05-22  1:36 ` William Breathitt Gray
2026-05-29  2:34   ` William Breathitt Gray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox