[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240918163100.870596-3-umang.jain@ideasonboard.com>
Date: Wed, 18 Sep 2024 22:00:56 +0530
From: Umang Jain <umang.jain@...asonboard.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>
Cc: linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Kieran Bingham <kieran.bingham@...asonboard.com>,
Arnd Bergmann <arnd@...db.de>,
Stefan Wahren <wahrenst@....net>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Nicolas Saenz Julienne <nsaenz@...nel.org>,
Umang Jain <umang.jain@...asonboard.com>
Subject: [PATCH 2/6] staging: vchiq_core: Return on all errors from queue_message()
In vchiq_connect_internal(), a MAKE_CONNECT message is queued
if the connection is disconnected, but only -EAGAIN error is
checked on the error path and returned.
However, queue_message() can fail with other errors as well hence,
vchiq_connect_internal() should return in those cases as well.
Signed-off-by: Umang Jain <umang.jain@...asonboard.com>
---
.../vc04_services/interface/vchiq_arm/vchiq_core.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index a381a633d3d5..4279dd182a98 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -2945,6 +2945,7 @@ int
vchiq_connect_internal(struct vchiq_state *state, struct vchiq_instance *instance)
{
struct vchiq_service *service;
+ int status = 0;
int i;
/* Find all services registered to this client and enable them. */
@@ -2956,9 +2957,10 @@ vchiq_connect_internal(struct vchiq_state *state, struct vchiq_instance *instanc
}
if (state->conn_state == VCHIQ_CONNSTATE_DISCONNECTED) {
- if (queue_message(state, NULL, MAKE_CONNECT, NULL, NULL, 0,
- QMFLAGS_IS_BLOCKING) == -EAGAIN)
- return -EAGAIN;
+ status = queue_message(state, NULL, MAKE_CONNECT, NULL, NULL, 0,
+ QMFLAGS_IS_BLOCKING);
+ if (status)
+ return status;
vchiq_set_conn_state(state, VCHIQ_CONNSTATE_CONNECTING);
}
@@ -2971,7 +2973,7 @@ vchiq_connect_internal(struct vchiq_state *state, struct vchiq_instance *instanc
complete(&state->connect);
}
- return 0;
+ return status;
}
void
--
2.45.2
Powered by blists - more mailing lists