From nobody Thu Sep 11 22:48:28 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92BD1C636D4 for ; Wed, 15 Feb 2023 09:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233743AbjBOJU7 (ORCPT ); Wed, 15 Feb 2023 04:20:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbjBOJU5 (ORCPT ); Wed, 15 Feb 2023 04:20:57 -0500 Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B15E27A9F for ; Wed, 15 Feb 2023 01:20:55 -0800 (PST) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id SDy8pGKTcPma6SDy8pv2OJ; Wed, 15 Feb 2023 10:20:53 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 15 Feb 2023 10:20:53 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: =?UTF-8?q?Marek=20Beh=C3=BAn?= , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] firmware: turris-mox-rwtm: Fix an error handling path in mox_get_board_info() Date: Wed, 15 Feb 2023 10:20:49 +0100 Message-Id: <60b29f04b47a60ae6da754034a608aae1eba053a.1676452827.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" wait_for_completion_timeout() returns 0 if timed out, and positive (at least 1, or number of jiffies left till timeout) if completed. In case of timeout, return -ETIMEDOUT. Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver") Signed-off-by: Christophe JAILLET --- Compile tested only. --- drivers/firmware/turris-mox-rwtm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-m= ox-rwtm.c index 6ea5789a89e2..577e87e1c6ee 100644 --- a/drivers/firmware/turris-mox-rwtm.c +++ b/drivers/firmware/turris-mox-rwtm.c @@ -200,8 +200,8 @@ static int mox_get_board_info(struct mox_rwtm *rwtm) return ret; =20 ret =3D wait_for_completion_timeout(&rwtm->cmd_done, HZ / 2); - if (ret < 0) - return ret; + if (ret =3D=3D 0) + return -ETIMEDOUT; =20 ret =3D mox_get_status(MBOX_CMD_BOARD_INFO, reply->retval); if (ret =3D=3D -ENODATA) { --=20 2.34.1