Thread (9 messages) 9 messages, 2 authors, 2025-07-13

Re: [PATCH 3/3] staging: vchiq_arm: Make vchiq_shutdown never fail

From: Maíra Canal <mcanal@igalia.com>
Date: 2025-07-13 18:49:10
Also in: linux-staging

Hi Stefan,

On 11/07/25 12:40, Stefan Wahren wrote:
quoted hunk ↗ jump to hunk
Most of the users of vchiq_shutdown ignore the return value,
which is bad because this could lead to resource leaks.
So instead of changing all calls to vchiq_shutdown, it's easier
to make vchiq_shutdown never fail.

Fixes: 71bad7f08641 ("staging: add bcm2708 vchiq driver")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 6434cbdc1a6e..721b15b7e13b 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -393,8 +393,7 @@ int vchiq_shutdown(struct vchiq_instance *instance)
If vchiq_shutdown() will always return 0 and most users ignore the
return value, how about turning it into a void function?

Best Regards,
- Maíra
  	struct vchiq_state *state = instance->state;
  	int ret = 0;
  
-	if (mutex_lock_killable(&state->mutex))
-		return -EAGAIN;
+	mutex_lock(&state->mutex);
  
  	/* Remove all services */
  	vchiq_shutdown_internal(state, instance);
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help