From patchwork Wed Sep 20 11:22:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Antipov X-Patchwork-Id: 726366 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 85B64CE79CD for ; Wed, 20 Sep 2023 11:23:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233786AbjITLXr (ORCPT ); Wed, 20 Sep 2023 07:23:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233727AbjITLXp (ORCPT ); Wed, 20 Sep 2023 07:23:45 -0400 Received: from forward101b.mail.yandex.net (forward101b.mail.yandex.net [178.154.239.148]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF74A3 for ; Wed, 20 Sep 2023 04:23:37 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net [IPv6:2a02:6b8:c08:47a7:0:640:b27a:0]) by forward101b.mail.yandex.net (Yandex) with ESMTP id 389476001E; Wed, 20 Sep 2023 14:23:34 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id XNHoIXCWpiE0-hbhFZ5PY; Wed, 20 Sep 2023 14:23:33 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1695209013; bh=m3vux/j8uFBfQnbpqxJmOqQ+33wRiaV6nSHI3iTnRTU=; h=Message-ID:Date:Cc:Subject:To:From; b=msfkMJoxGpNqNM+8BxIqJ0aEPvYMWAJUcGWVsHeq2WPdse6nsRVDtnGyoDVszBFn1 pcFLChtX9SQ2AaE1OfG8dLD+qYz/AdG0l4gZXmX8Zy6o8BQcqYzUAY9MUW9zTu2qjR 6ox3leiZ6OlQzAOikgXqv6o0LcisBXPkBY7NpBYM= Authentication-Results: mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Brian Norris Cc: Kalle Valo , linux-wireless@vger.kernel.org, lvc-project@linuxtesting.org, Dmitry Antipov Subject: [PATCH] wifi: mwifiex: fix SDIO firmware dump wait Date: Wed, 20 Sep 2023 14:22:32 +0300 Message-ID: <20230920112259.18656-1-dmantipov@yandex.ru> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In 'mwifiex_sdio_generic_fw_dump()', move (presumably placed by mistake) 'if (tries == MAX_POLL_TRIES)' check to an outer waiting loop. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov --- drivers/net/wireless/marvell/mwifiex/sdio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index 774858cfe86f..98f16eb8f298 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -2899,12 +2899,12 @@ static void mwifiex_sdio_generic_fw_dump(struct mwifiex_adapter *adapter) } if (start_flag == 0) break; - if (tries == MAX_POLL_TRIES) { - mwifiex_dbg(adapter, ERROR, - "FW not ready to dump\n"); - ret = -1; - goto done; - } + } + if (tries == MAX_POLL_TRIES) { + mwifiex_dbg(adapter, ERROR, + "FW not ready to dump\n"); + ret = -1; + goto done; } usleep_range(100, 200); }