From patchwork Thu Apr 14 13:08:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 561915 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0463BC433EF for ; Thu, 14 Apr 2022 13:16:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243924AbiDNNSv (ORCPT ); Thu, 14 Apr 2022 09:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243857AbiDNNSb (ORCPT ); Thu, 14 Apr 2022 09:18:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 330D49233C; Thu, 14 Apr 2022 06:15:48 -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 BFD5261378; Thu, 14 Apr 2022 13:15:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7FC5C385A5; Thu, 14 Apr 2022 13:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649942147; bh=lgXl8zCQY6xa9zZ0qFbUPVF6GNv7UQXWkdx6xDoq/4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PcCtpcbflEj//HIKyjrMBQKUZrk4IBEHrZ1VGawSoRZb+VdWYbrkk4jkt4LwqVIKb LrwhONBOUWIMb+RgrbRagRcHxq6AVcot35FDAQ3eoENrLVAMoj1nj7dykM5zAlkTS5 lCFd1wnuBkESR2lTv2eYgALkTxF/b9cUFO2UeOi0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Haas , Hangyu Hua , Marc Kleine-Budde Subject: [PATCH 4.19 032/338] can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path Date: Thu, 14 Apr 2022 15:08:55 +0200 Message-Id: <20220414110839.806524248@linuxfoundation.org> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220414110838.883074566@linuxfoundation.org> References: <20220414110838.883074566@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Hangyu Hua commit c70222752228a62135cee3409dccefd494a24646 upstream. There is no need to call dev_kfree_skb() when usb_submit_urb() fails beacause can_put_echo_skb() deletes the original skb and can_free_echo_skb() deletes the cloned skb. Link: https://lore.kernel.org/all/20220228083639.38183-1-hbh25y@gmail.com Fixes: 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface") Cc: stable@vger.kernel.org Cc: Sebastian Haas Signed-off-by: Hangyu Hua Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/usb/ems_usb.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c @@ -835,7 +835,6 @@ static netdev_tx_t ems_usb_start_xmit(st usb_unanchor_urb(urb); usb_free_coherent(dev->udev, size, buf, urb->transfer_dma); - dev_kfree_skb(skb); atomic_dec(&dev->active_tx_urbs);