Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp605608pxb; Tue, 5 Apr 2022 15:43:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyd7V7Nr14V02iVxaZmJHQHf/6O4qZCuCZ+XOwEFGGAAlsa1x1plFdYn/IxjR6NoQFL3K7 X-Received: by 2002:a63:78ca:0:b0:398:ae5:6515 with SMTP id t193-20020a6378ca000000b003980ae56515mr4661741pgc.345.1649198604397; Tue, 05 Apr 2022 15:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649198604; cv=none; d=google.com; s=arc-20160816; b=bH+8rb2snHmbgUNbrDpsaxVnQRHRsULeIm8pZ0g+3DkxgNNLdZka1EggoZsrXuf4Ps Ecp96EkYhyEUXI7FgMf9tQnKzqY/Si8fA0H9Alu/W1le0DLWoehLJWiWDtqae3Stexrr V6xv5W4fMofrufDtE7dXt0ZeL96lTr2vFXYWKIBmIrtfFkc1dX/QKpzGsDVOWJ4c6400 zWDg8i/aT3pDkL7v08d308IlWRRLBzMN4VaT3VpowPRK71jTcM/RjnPS5P2FR2zdCNPb /LU4UWmy4nCLlY73ceq4H68yewz0L9QW0I8pLcf3aNKbUmq/0l2ZphFCyLy2gs7Xi/aZ vY4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eiaKQg/KIF9RLUv7jqLynRQUBMoWnfuQyxgHyAAptRU=; b=VywR57f6Qqvd09N69ydkSLadJIJJ07/fjoARR8avyl28K3achTPFqOo9rnQbBb6Noi pZt3DaDl6dRyRzlfqIosSnszc+8TzLekRhpMIvrDhGWsC6om0KidSvk+JBATo0PkZpw+ mD1DDFK0J0mx4PhNEI6BLWswFTgZZkW47xlG4OrNV27yMvvjWfOcGx4Tcu0Au6tOGfVo m7GEuonfnX4ags9Xrw0/bLl5OAGj7K0lb75ymnAqR6eIAawFW6WCStzXVGMYfWw6jQaE /IpRVgiKCDztPJ4XttYte6Owe4UG2oZAdHvjyoWzYZ7QxHwVwOBpmZ1OfDpfEUbugvGX ZgHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sIkKJzXw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i36-20020a635864000000b00397ffaa5f06si14234884pgm.718.2022.04.05.15.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 15:43:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sIkKJzXw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 93E3C6E367; Tue, 5 Apr 2022 15:23:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349795AbiDENGG (ORCPT + 99 others); Tue, 5 Apr 2022 09:06:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344004AbiDEJQo (ORCPT ); Tue, 5 Apr 2022 05:16:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65679101FE; Tue, 5 Apr 2022 02:02:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 01BD061564; Tue, 5 Apr 2022 09:02:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17C37C385A1; Tue, 5 Apr 2022 09:02:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149368; bh=Uei5z8hVMTTP/ef+TzfjM7pNOY5Pj1gxvZnvJmGs/1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sIkKJzXwVB/kaHmKzUi8HxpwsS+7ZOKh+RLIaBTshTtOJIopYs/6xbz2ufZyH3YTC Dxugq6iyXnxY6ELCpJAHepKRJ6FyUwAah99ewwgLidXK3dQqWQ9Lde1ElrXV9yNH1+ NObaWFNIhsTUEc9wlUKvusTUE/AzODtqNOsCLDRU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Skripkin , Martin Kaiser , Sasha Levin Subject: [PATCH 5.16 0672/1017] staging: r8188eu: fix endless loop in recv_func Date: Tue, 5 Apr 2022 09:26:25 +0200 Message-Id: <20220405070414.227866929@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Kaiser [ Upstream commit 1327fcf175fa63d3b7a058b8148ed7714acdc035 ] Fix an endless loop in recv_func. If pending_frame is not NULL, we're stuck in the while loop forever. We have to call rtw_alloc_recvframe each time we loop. Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Reported-by: Pavel Skripkin Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220226181457.1138035-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/r8188eu/core/rtw_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c index 51a13262a226..d120d61454a3 100644 --- a/drivers/staging/r8188eu/core/rtw_recv.c +++ b/drivers/staging/r8188eu/core/rtw_recv.c @@ -1853,8 +1853,7 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe) struct recv_frame *pending_frame; int cnt = 0; - pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue); - while (pending_frame) { + while ((pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue))) { cnt++; recv_func_posthandle(padapter, pending_frame); } -- 2.34.1