From patchwork Wed Sep 18 16:30:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13807010 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 893F2CDD548 for ; Wed, 18 Sep 2024 16:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9k8dNzuUgoc9P4+2ptRec67w8c6jEni1Vrf1b90dul4=; b=RBwHEJ8CTpoiv5n3uqYTJodGnm T89YwbQyjpAwKHvpXeXje6fdQoxxWl1aiupT0VuUbXFqAEQnDjgPa8ATNXakA6RJVtU1H+JNryLJM 0fXJFS3fDkH0OOUx8ZYfWl1HT4DkWgVXIQxxmgMvlUkKEQex026VTLDnBY7phio2Fbq0QFbOph7ZG Esk8MIXBY3NR3izezWFmEMYK4hr/MqIUGgHZzgFVo9oJ+OAUsbpCs7OMUrbr+FQMO4BOrqwG+yq4W P22M1fcQFXqslfizm+5Sy6g2HDjbWwQtQB7ijXiTGniz9g2N+Srb5dB1OMRsOOe5hbH3C5g/DtN/+ RNDbEx7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqxdv-00000008dpe-3Emq; Wed, 18 Sep 2024 16:35:03 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqxab-00000008dHK-2RIn; Wed, 18 Sep 2024 16:31:38 +0000 Received: from umang.jain (unknown [IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DC194593; Wed, 18 Sep 2024 18:30:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1726677013; bh=sHrmkv7qdL/VGUyX+8A53+Ph6+f7Wq5flFy4YcSlqf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O2aULEyIGBmK0xBduyXBqZiu5uggYc7cDcj+2oqnmqG0u7cTYbVAYILxKb9T13LzC dlpumv/jOYknAem5RAKbpRhLXZ4bvFib6Nv3ooT364tdMPxj8BQdjeZ26/lkPVqand AGTCqW0/K8/0eM7yU0SuRgFweyQmEpen8PrJCRpY= From: Umang Jain To: Greg Kroah-Hartman , Broadcom internal kernel review list Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Kieran Bingham , Arnd Bergmann , Stefan Wahren , Laurent Pinchart , Nicolas Saenz Julienne , Umang Jain Subject: [PATCH 2/6] staging: vchiq_core: Return on all errors from queue_message() Date: Wed, 18 Sep 2024 22:00:56 +0530 Message-ID: <20240918163100.870596-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240918163100.870596-1-umang.jain@ideasonboard.com> References: <20240918163100.870596-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240918_093137_793030_6889893E X-CRM114-Status: GOOD ( 11.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- .../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