linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: bcm2835-camera: Avoid apotential sleep while holding a spin_lock
@ 2019-06-24  5:33 Christophe JAILLET
  2019-06-24  6:37 ` Nicholas Mc Guire
  2019-06-24  8:13 ` Stefan Wahren
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2019-06-24  5:33 UTC (permalink / raw)
  To: eric, stefan.wahren, gregkh, f.fainelli, rjui, sbranden,
	bcm-kernel-feedback-list, tuomas.tynkkynen, inf.braun,
	tobias.buettner, hofrat
  Cc: devel, kernel-janitors, linux-kernel, Christophe JAILLET,
	linux-rpi-kernel, linux-arm-kernel

Do not allocate memory with GFP_KERNEL when holding a spin_lock, it may
sleep. Use GFP_NOWAIT instead.

Fixes: 950fd867c635 ("staging: bcm2835-camera: Replace open-coded idr with a struct idr.")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
index 16af735af5c3..438d548c6e24 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
@@ -186,7 +186,7 @@ get_msg_context(struct vchiq_mmal_instance *instance)
 	 */
 	spin_lock(&instance->context_map_lock);
 	handle = idr_alloc(&instance->context_map, msg_context,
-			   0, 0, GFP_KERNEL);
+			   0, 0, GFP_NOWAIT);
 	spin_unlock(&instance->context_map_lock);
 
 	if (handle < 0) {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-06-24  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24  5:33 [PATCH] staging: bcm2835-camera: Avoid apotential sleep while holding a spin_lock Christophe JAILLET
2019-06-24  6:37 ` Nicholas Mc Guire
2019-06-24  8:13 ` Stefan Wahren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).