From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4134C636CD for ; Mon, 30 Jan 2023 20:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CD582z/KdYDy7h6a07vuGRW8OySE843Mq6tROacsxcc=; b=ntWszMhsuJFAlU lBiwP0Wd/Z+/r5K11oTf2aOpSXaxtswfUCDBITtNDlOwQE0Ru1V7M4BTJtRzm8V1hMaIaa9xToJwg EO9YYB3pcCc/rDWp8AudvUhlQYjdFSHgrNQHAUy5JozOxdRHj1EtiN4DyoFCo2PKtuOikamzx8v3G f628W+62prk5yD7J03QCsDpcCxzHpfq482nCXTyd31whmviHrbZ+Uk0z+v5b9Ps9XzukYeV4QE9b8 Q8nbqevWv6e/rT2ZEE8cM/392FLXaZ1k2eQ23Zl6DqwLLaqxnw4c4VYjDlx0wNIqPL6t/tuoQNf6j IkNQSQePHd1wkkFmGURg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMayr-005O4h-1B; Mon, 30 Jan 2023 20:42:21 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMayn-005O3q-UW for linux-arm-kernel@lists.infradead.org; Mon, 30 Jan 2023 20:42:19 +0000 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 7B1796124A; Mon, 30 Jan 2023 20:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E24BC433D2; Mon, 30 Jan 2023 20:42:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675111336; bh=oAro2jcac7Rko4BzuSdSd0vnnKeJ9Zl1UVwMJLXobKs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pWe/qpCR7131VcqO/bmmKgy2MS+KQaDQE7hRgBgP7CQ2Mh2sMFvlDLYiPCgjOflLL 4nfcbKXiVQHtT401WsYv9dE3FF95zm0Qzxnwg4c0CbT8kjV2RV3rG4gflIMFhZFWH0 OdrHjaoLKzSMrccbgqr1Jyu33leRkPwGpiMBgFvhtlIsMmS+mft1loCDPfXL0KSB6d Y8o9qtGDY5i9J9Axuklqt7dyhQWnQax1FyZHEo0h6tc4eEWzebl+IOnaw1i53omoGs /RYtjp00NtkDUMbAebQ2iizgj1KGOioPAs/+URBVN2Uxa5x7ivn8Lg26nfE06kdFcV GvtWgLTJhbNKw== Date: Mon, 30 Jan 2023 12:42:15 -0800 From: Jakub Kicinski To: esben@geanix.com Cc: Jonas Suhr Christensen , netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, michal.simek@xilinx.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] net: ll_temac: improve reset of buffer on dma mapping Message-ID: <20230130124215.1a06c5af@kernel.org> In-Reply-To: <87edrc8aav.fsf@geanix.com> References: <20230126101607.88407-1-jsc@umbraculum.org> <20230126101607.88407-2-jsc@umbraculum.org> <20230127231322.08b75b36@kernel.org> <87edrc8aav.fsf@geanix.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230130_124218_053410_A4957813 X-CRM114-Status: GOOD ( 16.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 30 Jan 2023 13:40:56 +0100 esben@geanix.com wrote: > > On Thu, 26 Jan 2023 11:16:07 +0100 Jonas Suhr Christensen wrote: > >> Free buffer and set pointer to null on dma mapping error. > > > > Why? I don't see a leak. You should provide motivation in the commit > > message. > > I don't think there is a leak. But if one of the dma_map_single() calls > in temac_dma_bd_init() fails, the error handling calls into > temac_dma_bd_release(), which will then call dma_unmap_single() on the > address that failed to be mapped. I see, seems worth fixing. Please explain that in the commit message, it's not immediately clear what the concern is, otherwise. On top of that please add a Fixes tag here as well and repost. > Can we be sure that doing so is always safe? If not, this change > ensures that we only unmap buffers that were succesfully mapped. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel