Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp920055rdb; Fri, 25 Aug 2023 05:29:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtGkYuorycZ38rEGXQp50QvkWkHeLxK8aUHXPU4MBLE5BtodylmwnmJqor27Mln95RPsQn X-Received: by 2002:a05:6a00:3983:b0:68b:e18f:2eb7 with SMTP id fi3-20020a056a00398300b0068be18f2eb7mr7084377pfb.1.1692966559952; Fri, 25 Aug 2023 05:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692966559; cv=none; d=google.com; s=arc-20160816; b=pYMhQUK3iBDwXZlgJycAywUTWG1vEVVDr4sxHrety/OrelMhYV+h/szTe8k722qU3h JXLBCbpNO4N8iHMM2FfxHBamkC/9+nCInKKU+jz9v07ekIxtyu2gzj330Red1GwwOcgf Wek5bot4YGqmTfgxubplUyAfjJWLVFVa9HvhNkx/fftSoGP5TFRxqNW8bAX2l6jSbyTx epLmHUCgByw+vz1YMOI8PzBPR+EKuvA4TdiYIyEEt1ZaEi7EJPjbZxp4RKA0++CaePoB ZuyvIMP9pPYYBwz7+w7VrDONVxrdUfaZIvzpbiuL7z+NmA+02kmgvRb4uyqAd0fb6cE4 tz3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dkim-signature; bh=lGfanuv7SeLJmHUAMSTRvz2Ia9oxHL4BuDeDFlUQ5mo=; fh=cYRUmJbZtk5XoTOndFbX0mmgd8Nx/inut2VAJqvUPjU=; b=uyz94yy3wvgP8IbFTNhLU41LAsquqZCwm1lT9BcrU7Qk9C/WKBPOnB3pAeUeUPIOaF MySfMABIujLR7vWdissC/8+R7p6U2a48KAmybqYmMKXnhzM5a2KQneibyiwCGkm+iLHh kPOn57WEF813ZzHZv2QHuw2mVjnyeD36wVFZ8chgrvosahoQGob4vezsJlL0kAW8xKbx T/dKk1oXLRB8m/TZelQKQsOteFb2xh34iWWHCRJ0yUnz1NctExUbhxnzExha62jnfKcK aQZz08Z12aB4wn4TUhUHIK4vm6h6kb1hLvZ8AGEyfM+XOPK435JyFXY0iy/iAbzvIQZP Unww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FWTduIcR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t23-20020a656097000000b00563de35d397si1530223pgu.487.2023.08.25.05.29.04; Fri, 25 Aug 2023 05:29:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FWTduIcR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242163AbjHYKCt (ORCPT + 99 others); Fri, 25 Aug 2023 06:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243310AbjHYKCk (ORCPT ); Fri, 25 Aug 2023 06:02:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 744FC1BCA; Fri, 25 Aug 2023 03:02:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1267666595; Fri, 25 Aug 2023 10:02:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28B15C433C7; Fri, 25 Aug 2023 10:02:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692957757; bh=JAU9g2CvtrHqFOZtrS2n1hIfXzY/RAqo3/y8vReZoNY=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=FWTduIcRkDaqLOtBr+aE+ap9YbeO/k1exE5LCETd/1NPSbRX6BFc3W1YUytbPEeAe LsihNROPxouiylEJysUmWDp0edsC6ftr78Ng/igL2/c5coV9Xw696uUJkbtJdgEGHx JhxlYGrvQiYwRxltt0muHYpsEw8ZHFrga69M/KfQcVu4qv8yyBk+uqcuw0birhDKa6 z3RC5WRjo3UahwMvcIr+mCtliK4dgtj0GeWuAh+2eLDJM7FTWSVSvjn2emw9vN4FFw X9An4U9qaQydu8JtKa+0EBbbk71e+or7V56CzeNWy7YcdZt72pI6XnuWzZ+Dd7F36i 5eYGPvME7rMbQ== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: wifi: rtw88: usb: kill and free rx urbs on probe failure From: Kalle Valo In-Reply-To: <20230823075021.588596-1-s.hauer@pengutronix.de> References: <20230823075021.588596-1-s.hauer@pengutronix.de> To: Sascha Hauer Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Ping-Ke Shih , =?utf-8?q?Ilgaz_=C3=96cal?= , kernel@pengutronix.de User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <169295775420.1850672.11682917620915060270.kvalo@kernel.org> Date: Fri, 25 Aug 2023 10:02:35 +0000 (UTC) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Sascha Hauer wrote: > After rtw_usb_alloc_rx_bufs() has been called rx urbs have been > allocated and must be freed in the error path. After rtw_usb_init_rx() > has been called they are submitted, so they also must be killed. > > Add these forgotten steps to the probe error path. > > Besides the lost memory this also fixes a problem when the driver > fails to download the firmware in rtw_chip_info_setup(). In this > case it can happen that the completion of the rx urbs handler runs > at a time when we already freed our data structures resulting in > a kernel crash. > > Fixes: a82dfd33d123 ("wifi: rtw88: Add common USB chip support") > Cc: stable@vger.kernel.org > Reported-by: Ilgaz Ă–cal > Signed-off-by: Sascha Hauer > Acked-by: Larry Finger > Acked-by: Ping-Ke Shih Patch applied to wireless-next.git, thanks. 290564367ab7 wifi: rtw88: usb: kill and free rx urbs on probe failure -- https://patchwork.kernel.org/project/linux-wireless/patch/20230823075021.588596-1-s.hauer@pengutronix.de/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches