Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp678670pxb; Tue, 5 Apr 2022 18:26:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXKbZJcEvmNhdA8w2Cw4ly8qzTNBDrFc9W38y14SIYzK/MMJL4sW8QVZcAxZqFAlJ3wODy X-Received: by 2002:a05:6402:26c7:b0:41b:7aef:bdf6 with SMTP id x7-20020a05640226c700b0041b7aefbdf6mr6417030edd.210.1649208365540; Tue, 05 Apr 2022 18:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649208365; cv=none; d=google.com; s=arc-20160816; b=VXJrIIAnFEPABDlg1UHcyb5WjKcHu4rn17wThTXSLx0Rz5Pk2H5x7Br99+rgLnLfYI mUyRkskF7I+41gKNtW1/DCoUbSFsdc9atiOMPS47iVKsm61bXSVxbnBqDhFuHtdiFKaH C+xs/EZuI4Vt6UsBTeNagELhSZdoeO/Hh3bDZktHWxZ6gswyi+nJyMtDYlPJe29xRgjc pWU5AJ96Mi/1e64IHPY4pzSLfefzyfcMdcahu4ov5OY7g99BS+U/Odp3dm/7tN230Fam t61Y0GhW4jEVMiEPWbMUstFI8g9kEP50R1rm3O0ka7cP5McnP5nufknSp+dOIf+rHk4j lYlQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Q7CCht8ylQQc5lmJDKjGVyODtl9UikMkOblAhaB5YdE=; b=k9iF1SKp4KmAV5+WACJLp6M/0fI48bYYRTu8zwH09pygWOnR68C2TvP+ytKarKTdtL sggLz5xOiiXTUBIF6L6EYJTuNU2OnHWyFnazhTzVYW/Cuu17YpS9NcykdmnIc1h22R1f QZOlP9j2hNonkpDIXX3gLdLdHC2WVsBrc4KALFqhb24/nuQDY2e/s/aSS5ATQcCOQ1rr IO6J8dE1BeSBGeD1dlRsdSYqNTXlrGl05NTBq7xy0HcCKwJRJ6x8ECkgvSIiqLcZLRLj UBGvMrJSWhj/XPdNuGqX8McB+GTA+fBBuBa06z7i24FwsI1p8977Y9m+EusCYdKxlz4L irUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vap5HGcl; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a056402278a00b00418eca4233csi11409519ede.470.2022.04.05.18.25.41; Tue, 05 Apr 2022 18:26:05 -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=@linuxfoundation.org header.s=korg header.b=vap5HGcl; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441819AbiDENwz (ORCPT + 99 others); Tue, 5 Apr 2022 09:52:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347348AbiDEJ0M (ORCPT ); Tue, 5 Apr 2022 05:26:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0563DE93A; Tue, 5 Apr 2022 02:15:23 -0700 (PDT) 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 794426164E; Tue, 5 Apr 2022 09:15:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83CA3C385A0; Tue, 5 Apr 2022 09:15:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150121; bh=ILBucAii6L59KbluEJs9UfkSEPcuI0aO3O8zzJAmlug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vap5HGclvTVNBJ4j3sLXsnnrwQ5498yRBhg1x6+fVqJ8loxHRh9syOvFxbxqvMTn5 JGXt8+SrW5VM6xZYsR6iw2WSbr3lFkjDRDLYf8CszFQmwBAVk/lLaeZ8D9guBWri3y i70wukyzrKhW7pLpoqncdhCgArj2z5K5zKADTFps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangyu Hua , Marc Kleine-Budde Subject: [PATCH 5.16 0923/1017] can: mcba_usb: mcba_usb_start_xmit(): fix double dev_kfree_skb in error path Date: Tue, 5 Apr 2022 09:30:36 +0200 Message-Id: <20220405070421.615707346@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Hangyu Hua commit 04c9b00ba83594a29813d6b1fb8fdc93a3915174 upstream. There is no need to call dev_kfree_skb() when usb_submit_urb() fails because can_put_echo_skb() deletes original skb and can_free_echo_skb() deletes the cloned skb. Fixes: 51f3baad7de9 ("can: mcba_usb: Add support for Microchip CAN BUS Analyzer") Link: https://lore.kernel.org/all/20220311080208.45047-1-hbh25y@gmail.com Signed-off-by: Hangyu Hua Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/usb/mcba_usb.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/net/can/usb/mcba_usb.c +++ b/drivers/net/can/usb/mcba_usb.c @@ -368,7 +368,6 @@ static netdev_tx_t mcba_usb_start_xmit(s xmit_failed: can_free_echo_skb(priv->netdev, ctx->ndx, NULL); mcba_usb_free_ctx(ctx); - dev_kfree_skb(skb); stats->tx_dropped++; return NETDEV_TX_OK;