Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2199683pxb; Fri, 25 Mar 2022 12:54:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyl7O6p5DOV+YD/5tqqyi3MDwC1obiqnnl3bZ+515F9ZhdN6f1ieaV7KDkNFccbsH7nqjZj X-Received: by 2002:a17:903:11c9:b0:154:be2d:eb9 with SMTP id q9-20020a17090311c900b00154be2d0eb9mr12834576plh.91.1648238082160; Fri, 25 Mar 2022 12:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648238082; cv=none; d=google.com; s=arc-20160816; b=OKN6oKhPt72X0SLrKwZOl1n2VVwy0nh3bvE/P4QIvgKeNveE5y9hctW2JU/otGg0cE eVWsrqPFerJXSQXQUQ4SVbGFcjDjwMR7h1G5tw55P3B6inksBwnyjm/+3EJzISES5UhQ +pFHFxhJU8ROu9aClihmyZoOjdzYPZYwSLUXZp12i4JoqLn3epvGP5INfhAVTc+c/7YT Qn2+pIZP14M3huxt4mT5HyJo8Nq/ZNLrA94AQK25CsW5GvV1H0psgbRJno/xqi/M136T 1iEaUR2Tps4+8mENVDA3B76u8vm8rVW59djOiz01SG8roK5CgsnFcmFNDqJEhPT5hRzT z6Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WVuJ5iTMnLNg6p4o6FYZzWHkDiNOVLzOVLvxqh6C8Y4=; b=uWoMq+q5E/C8IxtRHL/qy498Y9/s++oGwhVG422y1ocp0F+PLRa4phbI+zjkZvYm4x 7W4ENPu34pkaBlDtD90wo0a7yztzm06KUW0Er/JA1AATZ9A5+HXOAiDFohYb2Uq2Zdt4 PJEt/srA0OXkhqLvR2pRqWDMikDC1Bjsk+DvnOti7sclFYYFDYARKSrFLa1JTtkK5w0+ rTuyPizSOUX5LAo+Shugh17G7fFFvHjGuDL/HHDkY14dypkEl8RjBAjxLa03KjYGrE20 onLn762F0aE1zWatHaMNNxzFPtj9NK9kgk1C/wXc+QfTNdMUTAAbARP68GqjVV2oHLWB UhdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@spacecubics-com.20210112.gappssmtp.com header.s=20210112 header.b=LlXGZhX0; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t138-20020a635f90000000b003816043f022si3251051pgb.535.2022.03.25.12.54.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:54:42 -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=@spacecubics-com.20210112.gappssmtp.com header.s=20210112 header.b=LlXGZhX0; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A74572E804E; Fri, 25 Mar 2022 11:43:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230052AbiCVXJ7 (ORCPT + 99 others); Tue, 22 Mar 2022 19:09:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbiCVXJ5 (ORCPT ); Tue, 22 Mar 2022 19:09:57 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4D9B5EDCC for ; Tue, 22 Mar 2022 16:08:27 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id t5so35249pfg.4 for ; Tue, 22 Mar 2022 16:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spacecubics-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WVuJ5iTMnLNg6p4o6FYZzWHkDiNOVLzOVLvxqh6C8Y4=; b=LlXGZhX0rVNs3cNb3DAGu9aomSpRR2vuW7l7DcvmvZVZMKPgeUSI7WxeyGGKf6V3+v 4q2Az1q/1o1sFKWPwC4qHAM9UwHxP2ZpGa6kjxB5e3YcEH44psttcBZgtOom+aa3qDEx QnAZWL9FNaQesELzuft1OW9ZoJ751IRQKRFK4Qy+kjZW++9xQtx40OXaEmhXpsdTydaQ ocKEYwgkVDMMCTvNJuUiCOU5mlr3HCkzjtg2zjkQZTxeun8p2VdGNx25frevoEfsn4vu 9XwWyaqB6PWKQXO1V+JwKP0ZDzdW9ZTkSCE9brkxKKJA92CRiaVv/8LumBs2EmSGk5qQ iIMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WVuJ5iTMnLNg6p4o6FYZzWHkDiNOVLzOVLvxqh6C8Y4=; b=zXxp0BgxuMZCvvoRyklR7JntHEJPMvl1irEeJj+ntHDnjEoXKg0A/xTqsE1S/xYoif rlrE15ykLYeaA6DgHtkACO3t/ROXdJfoyWEb/V4hF9cII/aqo3RKWEPncBm2kIdzan6j zgoD4zG7msDogmlTZkABeas6N+YotjSD+YepDe87MEzZCrnn8Ek4WFOJnWBAade4IC4Y qJRcrZdTwdXeo5ILPKtN2vBz+Lbpuu0UVH9gEW8p9Tx35IAk+VCn5Zp8aZpr3zmAPdAW iv8tXEup7vLJqDsVU9RqWecuX7EEKjBPrShpknbZpPA6Hfrb6R/79tjnLP5SWMYJzDac kZGQ== X-Gm-Message-State: AOAM532oly4XmMskYzXsnMl36Hx+ZONZQX9T2sQnBRu1pHQqieJSE5/i tpj7s8fFn0F3Pw5jeFjYStWQSsY6703VH4FsQCPrUw== X-Received: by 2002:a05:6a02:19c:b0:385:f2a0:2b38 with SMTP id bj28-20020a056a02019c00b00385f2a02b38mr3263566pgb.286.1647990507325; Tue, 22 Mar 2022 16:08:27 -0700 (PDT) MIME-Version: 1.0 References: <20220311080208.45047-1-hbh25y@gmail.com> In-Reply-To: <20220311080208.45047-1-hbh25y@gmail.com> From: Yasushi SHOJI Date: Wed, 23 Mar 2022 08:08:16 +0900 Message-ID: Subject: Re: [PATCH] can: mcba_usb: fix possible double dev_kfree_skb in mcba_usb_start_xmit To: Hangyu Hua Cc: Wolfgang Grandegger , Marc Kleine-Budde , David Miller , Jakub Kicinski , Vincent Mailhol , stefan.maetje@esd.eu, Pavel Skripkin , remigiusz.kollataj@mobica.com, linux-can , netdev , open list Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 Hi Hangyu, On Fri, Mar 11, 2022 at 5:02 PM Hangyu Hua wrote: > > There is no need to call dev_kfree_skb when usb_submit_urb fails beacause > can_put_echo_skb deletes original skb and can_free_echo_skb deletes the cloned > skb. So, it's more like, "we don't need to call dev_kfree_skb() after can_put_echo_skb() because can_put_echo_skb() consumes the given skb.". It seems it doesn't depend on the condition of usb_submit_urb(). Plus, we don't see the "cloned skb" at the call site. Would you mind adding a comment on can_put_echo_skb(), in a separate patch, saying the fact that it consumes the skb? ems_usb.c, gs_usb.c and possibly some others seem to call dev_kfree_skb() as well. Are they affected? Best, -- yashi