From nobody Mon Jun 8 08:28:41 2026 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 300B0175A81 for ; Thu, 4 Jun 2026 13:33:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780580029; cv=none; b=JAm3BLxlmyWYUYdzmtEJ/RUU5hrDMVUuUADIm+JsoALBknC9RlBpIkvc4/QLdQm/JloSNse5MMpPdnTbeRcyizK4ov8pYBGvBN3kSNQGkXZDR/osJLVecECkdlt92mJy29wxDM+s6JrXnn9EZN2uU0CrpID2LBXtZ8UJFfFvbr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780580029; c=relaxed/simple; bh=Ey/g0s8kBxT+ZD6jEWAOa5+ynCnh2fBSkjF6Jxdb5+Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FTc9vKHhozZ5HiRbvTMaFObylj6g+uAcfo5VS7kKB8MY4VQuq/LaCY90/8MX8V+cESKIo9jO1AvWZ7TL7Z2eiUXpKfTvEtwP5do3p+3+XeBhzZVL1Bhmq3ADnKRcueAJfAxvcxLrG/kY4jlMPHV5JZwAjC1r+tNroiDdtjt8oDU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ispWrsVX; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ispWrsVX" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-46015dc517aso627982f8f.2 for ; Thu, 04 Jun 2026 06:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780580026; x=1781184826; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=W0N9w0NcpoevzC5VyLVmVPGnT4XvGQAjwzUN/WuPFpE=; b=ispWrsVXEXBZWJNej3gdklp3F/uqLQB05UDYRx6fwqVGBxbvajY/yHE80nW6Oeexvs Bmu/gt8l0nc9+W7s0J8OwRK+njUZ8MSPEPjOpD/rOrbG7XOqaH3Y6XniVmAriTXosjTm 3NMSfrxh1AO8QWENvPsBZsqoGTbQiWM0tqFg+2JopfB2OqHAPp4DfEwdyLYxjhBpRheG RAwIOIH7ZfIKW86x9+0zbFRd+uXDv5FH2otE2/2YFQxpUkWdwoEgrCEF1HpsXhlAvu9S YuBDoDH8GPmT39Pf/nJayVJwuMPRsVOVtdA38dB9VEoQN4IkUu40A35li4bBu2jM3VTS v81w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780580026; x=1781184826; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=W0N9w0NcpoevzC5VyLVmVPGnT4XvGQAjwzUN/WuPFpE=; b=HWSSM3tyTgnLWGn4UJU24Rdl2U7++itRGdK1JMihi/dvfBjRAdY7dp+w/uYJYuPiQz hC7a+SF1GxLAP9LoHLOYmbx9sJDr1ikW3HUI29b84VCuZTouTqLxfX9G/7AGWqmjuEfU XDySpRmzTGlrKiDvGL/CEPeJOxTfODZF8vabCcpESZX6tYyDA6bOXohSIXeWTpXhq6BD t+g4/Y4cnFzugqTQoKpOfAhaXXOF0DHqM4Z5XBvyeZGGWNwE27uvYFYT0coDLhURe6yx I/avsxfPTwLZOlYOcXjPwLTNOx0Yb3KZpyJQWROSmajL/LNBcgLVy005CnSZeOd1iYNk NPAg== X-Forwarded-Encrypted: i=1; AFNElJ+SoMvMBTJFdGDKbbdTiYRja5W7Fi7wYNAgbntuAh++dSjvLq+mXFWIL3h2MneXNxYzKDrcvnwgUHAPO9c=@vger.kernel.org X-Gm-Message-State: AOJu0YzPKzxHQ7mP1jTUMLHL7sndrPJr4DJgWKVJBLYgjfmJNJ2IcDac rWN1qUlNmSjdQ6XivDsTjTFUMCJLOUIub6trsAVcuHXAPdN1tDBvT1tU X-Gm-Gg: Acq92OEkiGrpOFhLzsy7ILD0UNvF8PHTmH41Iu9z6tyeIvxdI62DG95s/43HgW2HObJ FTNUaMfeYeVPMl3r2GTyFjPaiV9lNRtbZstkYIf2GYMelv9A32mO6MT+/kres0dYfngL1L/bt7W HGSEy9JGJzouZ6cmmN2bhXJF37KeaBbass0yMSjqhIGmSH+rXyi1xl0NcrFo5Bq6oa7NIw7bmzB bgC8Lynar9Yg2DQNxONrlNaup+u+In+35aeOrN+WuSp5DHPPRSKVgDOVpGl6aUq04+iCnngnopV WMz4MbZLFKTBnkkL21/ROUYoCtgAxivv09c/Ml+WxidkuO7W40W4fM56BszKnBR2A2Q+HigEfb1 yRBE8FZkuzKBeDRbBp6+InH9sfcOnuu0YjZ5MbCC8wdgirfXOOU5cFP+xC4hrN/+eJkRmVdkQDV QWyoYOowPCRHc0bzK/qzoX6k+4IipPIk0r5xQqjOpZ7z1/KrSGZPT3Vs+njoxVxbLa2hZlGBLHx mnm6mJEWXvrrrw= X-Received: by 2002:a05:6000:4029:b0:45d:77f4:1ac2 with SMTP id ffacd0b85a97d-460215f27cfmr14353881f8f.0.1780580026307; Thu, 04 Jun 2026 06:33:46 -0700 (PDT) Received: from fedora ([102.78.131.247]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f2e4004sm16424770f8f.9.2026.06.04.06.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2026 06:33:45 -0700 (PDT) From: Jad Keskes To: gregkh@linuxfoundation.org Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Jad Keskes Subject: [PATCH] staging: rtl8723bs: call scan/join timeout handlers directly Date: Thu, 4 Jun 2026 14:33:15 +0100 Message-ID: <20260604133315.188125-1-inasj268@gmail.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The survey and join command callbacks defer to the scan_to_timer and assoc_timer at 1 jiffy when the command fails, instead of calling the timeout handler directly. The TODO comments in the original code explicitly note this should be done. Replace the _set_timer(..., 1) deferral with a direct function call to rtw_scan_timeout_handler() and _rtw_join_timeout_handler(). Cancel the pending timer first with timer_delete_sync() to prevent the original timeout from firing later and invoking the handler a second time on already-cleaned-up state. Both handlers use timer_container_of() to recover the adapter pointer from the timer field, which resolves correctly whether called from the timer subsystem or directly. Signed-off-by: Jad Keskes --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl= 8723bs/core/rtw_cmd.c index c1185c25e..cf0a67aff 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -1793,8 +1793,8 @@ void rtw_survey_cmd_callback(struct adapter *padapter= , struct cmd_obj *pcmd) struct mlme_priv *pmlmepriv =3D &padapter->mlmepriv; =20 if (pcmd->res !=3D H2C_SUCCESS) { - /* TODO: cancel timer and do timeout handler directly... */ - _set_timer(&pmlmepriv->scan_to_timer, 1); + timer_delete_sync(&pmlmepriv->scan_to_timer); + rtw_scan_timeout_handler(&pmlmepriv->scan_to_timer); } =20 /* free cmd */ @@ -1821,8 +1821,8 @@ void rtw_joinbss_cmd_callback(struct adapter *padapte= r, struct cmd_obj *pcmd) struct mlme_priv *pmlmepriv =3D &padapter->mlmepriv; =20 if (pcmd->res !=3D H2C_SUCCESS) { - /* TODO: cancel timer and do timeout handler directly... */ - _set_timer(&pmlmepriv->assoc_timer, 1); + timer_delete_sync(&pmlmepriv->assoc_timer); + _rtw_join_timeout_handler(&pmlmepriv->assoc_timer); } =20 rtw_free_cmd_obj(pcmd); --=20 2.54.0