Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp670209pxb; Tue, 5 Apr 2022 18:06:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/wjymKiKA9VbJHdIWt0sJEsEedXSLqTLcB480kjKalvXi8JiuS+PmT9pwFbDd88DaVDLD X-Received: by 2002:a17:907:7e92:b0:6e0:8c4f:b5a with SMTP id qb18-20020a1709077e9200b006e08c4f0b5amr5873887ejc.572.1649207175941; Tue, 05 Apr 2022 18:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649207175; cv=none; d=google.com; s=arc-20160816; b=ECRFHcdMkI7XEM5YbtAsjEL5BF3s0d6gBFVo+VHFS9xUEm4JMRM7i16NnD23meYuOz qkVKCl22uARGzekX2sN4zIGsSVb/bSMETemS3xhWTvQe7RKlmvVdhFfkhVq7rGeYmOGy iAcVhTlbS5szzjRMdt8ifjMEZ2CZDf5iHDHNHQhxupWdLJ2LZyZCzur63D8cPlU44tsD UBBZMDuhE1blfTgT9YzBX6aFZk8Z6qBjmih25e8Nnx3B6NxW/Mhc/AxMjS19A8GRC6AY 8McHfwz3svEMvXYD4J5/FAWPeVkUJcAflKHmM65fdknFPEvV6tsPciATbtjr91CrklTS gsNw== 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=wv9D3YgELouDm4Je60/Oz9hwqIz8WN7OjSVCgy4D8sM=; b=tynRjniG74l6J5aOZZWsddzsZ2+sltsW3r8zg2IWLNDBE25ia0uJ0DSEiy9N0D3Lyu MU5sLO2XcBeuHIAPxd2BivfLRcJaZIQP8kYDK1pH1ZwAf0PIqR0JVxBlde36SDzswAhR 7MEVDXKy7JWvNQr/M0Z7hJOdOKlufQZK4E3SGoDDAxqNAGDcZkcnLpY/MYOznUD6LaD6 MmeXQgjaCAKnDB/xVNCqNwX2UgO9ct/rF1qPmxKRqbfVx/+0p3Wt6iLz/0tXq71Dhdws yCUMKKejRvCvDHv6CJdKtLIeKTD+pu+DCo78fbvixyNTBcfsuBaIIgqCkPxoP2NjYR9v fHNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=q1LxRMsd; 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 u11-20020a17090657cb00b006e7eb8d14e6si6589631ejr.882.2022.04.05.18.05.50; Tue, 05 Apr 2022 18:06:15 -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=q1LxRMsd; 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 S1353654AbiDEKIs (ORCPT + 99 others); Tue, 5 Apr 2022 06:08:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241003AbiDEIcn (ORCPT ); Tue, 5 Apr 2022 04:32:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA719AF1FF; Tue, 5 Apr 2022 01:25:52 -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 ams.source.kernel.org (Postfix) with ESMTPS id E5F20B81BC1; Tue, 5 Apr 2022 08:25:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45E61C385A2; Tue, 5 Apr 2022 08:25:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147149; bh=iq8AqRU800SkK5yV2TAoTB1ZOPRUbNaL+4tPg++3X4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q1LxRMsd7z8j0F4S83IcPTmq3TZW1Um8fql7FzzqpIxogP7jYDkoeBvhhV14XkxQY tanGcWWIdah7V4XlZdpwgsJeEDYhZTjYyvVqRjEOePT3UW2/7p3u5Rn5FmFsGgG/km SdNjcyUnkXrRxaIcelNXesysDoznWktlLx8Lm6cw= 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.17 1020/1126] can: mcba_usb: mcba_usb_start_xmit(): fix double dev_kfree_skb in error path Date: Tue, 5 Apr 2022 09:29:27 +0200 Message-Id: <20220405070437.424550501@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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 @@ -364,7 +364,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;