Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp284663pxb; Thu, 20 Jan 2022 13:30:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7OcoxgUIcqjwYV02h57oswCx487GeRiJYlBkFknyYHdvQw3uK1d3CxH1j8M0STsZmOTnX X-Received: by 2002:a17:902:eccc:b0:14a:eb4c:1c39 with SMTP id a12-20020a170902eccc00b0014aeb4c1c39mr647078plh.112.1642714204412; Thu, 20 Jan 2022 13:30:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642714204; cv=none; d=google.com; s=arc-20160816; b=MHzeAwHGVb+zqFrS8IMrhfnSy0jEr9zQkoBL2R0LZGzSCWspU0q0rn6DEBqrawX8xh T9Bb/OQK9/4mc58iE5XI36MbkY+b2gdGezfpBES775nge9YptYZJd3ES7yfaqy/IEnu6 F3lOX+uoGYfOsWKy+fgwM/aMsbMnXWYe/uAAcq6WM4+V/7oGurTbsLjqyWbtWNlN8XiZ n8mwMKaLsTm7IUPtTw3YhBI4as3Sp6i2EBwdJJ3Zi7QcPx0JrurAdoNbO/EBsIeJCEBp orfGy0TIy51rF8nj/PjAeTz671eAzLl0corknZZFEEozvGUNaIjn7F4QTGf4Ec3WcNGD o0Jg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=AGz50RsFOpK1ratnDNRwMTAFQ/bNsrXoiTvvgt+u9qw=; b=SpexS0bwt/WaLnN+DGZ1BuOvya2YPccF7+VNp2Z8BpzBx1A9+58T+E10/pSM+cDqvI uj0FZ+v/VbyaAKKLiLzoRZEzUiLK8uTYCQF/DCAm79yNpOu+PBAuVcUEM0qlcxAua+i5 Mcw4+SH59lt+3ckdgXV6Z61lPWiy5GTU45h6VjDkhNjKtG4ksw94WNQCOcW9A9c7lBfI SGD4xCZH5tFSyJuL3YJcvsRW1ajO+s0n/yXUjSt5wAUo/EdkflvrvPI8oC8MsAMDKtZ9 ktmpPw3Muqv0SlcEEPB37tgavhz4Mqj+LzJfncYvbQ8GJjKhJs0mtGPGaXvE6yZ1tDeT 33IA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b184si2214994pga.232.2022.01.20.13.29.55; Thu, 20 Jan 2022 13:30:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244458AbiARSW0 convert rfc822-to-8bit (ORCPT + 70 others); Tue, 18 Jan 2022 13:22:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244323AbiARSWZ (ORCPT ); Tue, 18 Jan 2022 13:22:25 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 876FBC061574; Tue, 18 Jan 2022 10:22:24 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id E3A92100002; Tue, 18 Jan 2022 18:22:17 +0000 (UTC) Date: Tue, 18 Jan 2022 19:22:15 +0100 From: Miquel Raynal To: Alexander Aring Cc: Stefan Schmidt , linux-wpan - ML , "open list:NETWORKING [GENERAL]" , "linux-wireless@vger.kernel.org Wireless" , David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Michael Hennerich , Jakub Kicinski , Varka Bhadram , Xue Liu , Alan Ott , Thomas Petazzoni Subject: Re: [PATCH v3 17/41] net: ieee802154: at86rf230: Call the complete helper when a transmission is over Message-ID: <20220118192215.3f380866@xps13> In-Reply-To: References: <20220117115440.60296-1-miquel.raynal@bootlin.com> <20220117115440.60296-18-miquel.raynal@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Alexander, alex.aring@gmail.com wrote on Mon, 17 Jan 2022 19:36:39 -0500: > Hi, > > On Mon, 17 Jan 2022 at 19:34, Alexander Aring wrote: > > > > Hi, > > > > On Mon, 17 Jan 2022 at 06:55, Miquel Raynal wrote: > > > > > > ieee802154_xmit_complete() is the right helper to call when a > > > transmission is over. The fact that it completed or not is not really a > > > question, but drivers must tell the core that the completion is over, > > > even if it was canceled. Do not call ieee802154_wake_queue() manually, > > > in order to let full control of this task to the core. > > > > > > By using the complete helper we also avoid leacking the skb structure. > > > > > > Signed-off-by: Miquel Raynal > > > --- > > > drivers/net/ieee802154/at86rf230.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c > > > index 583f835c317a..1941e1f3d2ef 100644 > > > --- a/drivers/net/ieee802154/at86rf230.c > > > +++ b/drivers/net/ieee802154/at86rf230.c > > > @@ -343,7 +343,7 @@ at86rf230_async_error_recover_complete(void *context) > > > if (ctx->free) > > > kfree(ctx); > > > > > > - ieee802154_wake_queue(lp->hw); > > > + ieee802154_xmit_complete(lp->hw, lp->tx_skb, false); > > > > also this lp->tx_skb can be a dangled pointer, after xmit_complete() > > we need to set it to NULL in a xmit_error() we can check on NULL > > before calling kfree_skb(). > > > > forget the NULL checking, it's already done by core. However in some > cases this is called with a dangled pointer on lp->tx_skb. I'll try to fix these dangling situation first if I find them. I'll also introduce a xmit_error() helper as you suggest. Thanks, Miquèl