From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90F2C238C0F; Thu, 30 Oct 2025 15:34:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761838465; cv=none; b=Thce54Xf05OLtOlCzMCXPr1S557Nikdt9VGnuyRVVSfVDANlJcdMWC48R4Z8FeROZrCiwL7mVX+exkrscDmW1ziK2P/MZDd6zY4kIoitEQzTjNM8zx7YQapJf6xqnZN8vg13XLxkxk+EvvMO/SY11x4rvKiWF1nM0rdyWA2T6OU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761838465; c=relaxed/simple; bh=kgsVePG1TDxPoCEnHRNZviyXsOn86/lu7qyI5hHRx8Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lJkDTx+GJar5bMYfV9v4wMxJQY1WQ/YXWtEe8xc4HlNUHuozrBMnJaWSEM83DBq6h5wQTq0MgDFBoQzHPazINVD6WyrmELRv7RUrssmUD79XHR8V+Fx9zNi0iiBZeHpgFebwZwJFyCj6D2jguB8ZwP3UiXZ3+onYGnEyotBQ/Pk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=odw0elaP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="odw0elaP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9B1CC4CEF1; Thu, 30 Oct 2025 15:34:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1761838465; bh=kgsVePG1TDxPoCEnHRNZviyXsOn86/lu7qyI5hHRx8Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=odw0elaPMR4clHhHnr4spCjpZ4KKvaMHxn+ZIlx9e8emLqD5aBZtvy8sGkVkt+DNP ZkiqdlIdt0UUIqbfdeIX6e4c6epE+35BLoZiRa0lCySqTKqxrt/2haytT+t4xHqYNa foOclgJ6upZB1mJmJ2T/SqWdkLhcryjiDGtKJqko= Date: Thu, 30 Oct 2025 16:34:22 +0100 From: Greg Kroah-Hartman To: Kuen-Han Tsai Cc: Thinh Nguyen , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] usb: gadget: f_loopback: Use auto-cleanup for usb_request Message-ID: <2025103059-suitable-mulberry-45e0@gregkh> References: <20251030-auto-cleanup-v1-0-db30584fadfd@google.com> <20251030-auto-cleanup-v1-2-db30584fadfd@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251030-auto-cleanup-v1-2-db30584fadfd@google.com> On Thu, Oct 30, 2025 at 11:14:20PM +0800, Kuen-Han Tsai wrote: > Refactor f_loopback.c to use auto-cleanup mechanism for usb_request > allocations in alloc_requests(). > > The shared buffer between in_req and out_req is handled by nullifying > in_req->buf before returning on usb_ep_queue failure, ensuring the > buffer is only freed once by the out_req cleanup. Same here, it's tricky stuff, and you are only saving 4 lines of code? Not really worth it I would think. thanks, greg k-h