Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1016814pxb; Wed, 6 Apr 2022 06:48:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw2I6zldaskHP7GId5e7Kewty1a6q+LPprTzjFw4dVovxSW0L17FrpFiYL9nUwIRl9AhbD X-Received: by 2002:a63:7258:0:b0:398:7298:c4b6 with SMTP id c24-20020a637258000000b003987298c4b6mr7222223pgn.436.1649252935077; Wed, 06 Apr 2022 06:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252935; cv=none; d=google.com; s=arc-20160816; b=1KkZ9Rd+3keqNOR7pNhMcynyRbrOTT1tMRkivDgkvjK+NPOtlZIbOo3HQovbQxqznh 6iaaVfLmVkxVlblQlamneTz1KLgnCCJg8dpB2PwYjcZFCMDkAks8lw4K32c+j8PM/ye1 ZtyGwO+DpJUJKMYWdO0Rh9ZxqdIK4jimVVJTJ5VF3uXGuRkshqj5W10CbNnw0ssQeU0O ZiFcmz6dXkAwraTau8/+rrNG+pRQRqxBJy+6KxdqLqBIiHFipXKJ7JdH/+FW2hXtynXD LI/YH8EIiV+/4YkVq3m6iiiaq+8Qkneha5dpmrbJjhzCEKYLRQVRA3wyaHEdj0pAfrSf UZqQ== 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=bwXPLEtkCPkwwfDMCCxI0MGr/SD13Abxq9XyFGDBfo0=; b=RaIYCJ0iWdz6uEhifTJkYlJge2M1V7y313G6mTNB2YwqDrUKnyv60Z4CK6WEiRlVSl jCFtZTpf9+/H1MwUd4h1fEAGq3oPbVx/4BbIc00CcwHbTeWsggxC27FCVqU5imemDHke T3cV19hpz0eZ6SzAhvTHyRX2dLJqmfCtswr0YD6sE3gsaJDKTScbgytXHDhKkOfxMJxJ u0Nxqmdm8Bp1cG30Z6t0+L9B4ocdlQss75UaRIXeWp59wFSijIcSjslfhuhBp35r7rQx hkKUAOSvqYr84Y7zgdg5OO8ww2NH2qZ0Kj5rUwzdi+3sxb4RA+P8KhPGIyD/klF32Blw ZDMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mMr+n9w6; 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 p16-20020a170903249000b00153b2d164a2si14924573plw.170.2022.04.06.06.48.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:48:55 -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=mMr+n9w6; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 59362619149; Wed, 6 Apr 2022 04:44:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1578597AbiDEXYM (ORCPT + 99 others); Tue, 5 Apr 2022 19:24:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349450AbiDEJtx (ORCPT ); Tue, 5 Apr 2022 05:49:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B23BB27B20; Tue, 5 Apr 2022 02:46:13 -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 4C4956164D; Tue, 5 Apr 2022 09:46:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E93AC385A3; Tue, 5 Apr 2022 09:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151972; bh=Erirp5qaLkmT2KhloGasa14482cQS95b1zyeEUKtpyc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mMr+n9w61cnl0LydRa2hhEDZgoMDJxB9UfThttNvQxhU8JqbmlWJqQ4aRlDXMGo83 mY2OdxT9pA8El8y7ivf/baSZ7d1PyXGQR5pZW2yVoz6obpVcm6Ha8oI8q4mx4qw7CG LayLWgfc6lIh0aTB7vqe5UmBL5ilMrHlLDXOi5Go= 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.15 607/913] staging: r8188eu: fix endless loop in recv_func Date: Tue, 5 Apr 2022 09:27:49 +0200 Message-Id: <20220405070358.036454946@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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 e082edfbaad8..30ca9f1e0363 100644 --- a/drivers/staging/r8188eu/core/rtw_recv.c +++ b/drivers/staging/r8188eu/core/rtw_recv.c @@ -1942,8 +1942,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