Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3393958lkq; Mon, 23 Nov 2020 04:42:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3TPvHgUk3bgaOxCcy6iIQqY1jbB6IGhStY8aqpKpVeMe1kMJCpi/swEZlqWB42XOtslv+ X-Received: by 2002:a50:d490:: with SMTP id s16mr28633303edi.187.1606135350055; Mon, 23 Nov 2020 04:42:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606135350; cv=none; d=google.com; s=arc-20160816; b=qcvrNLQrzwQOpCnEj1eL3ESSCY89V+Y3duBI5t8BBKEfrgmTkoyFxkn+3HxpmDIHI5 OIxYPBD0JvgdPKs738d/FMAX1QwkzsrArobLdlyM7Z2ZWOP1fNIc0K9JdBLzznA3hIBL bLmEtOXuxtd367tEQpSPlpW/VSIzuuiAfq2vYrHyAb4B2Xq+f4zbafGtWXgWIkNfwQBJ 4zpoD+5EU5VwpQzMCot6DbnWg2IqZVoF7q/mScG/V1fFTuxZlgxAnoRIjOsCrUzsxvYP l2napw9pzk6CSsXlU01cDoCnb6qxV0WV4UoDYorY8auddIchZytqNVncj5znNY9fneDI 0Qxg== 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=PB/BSQjf/FWs37GHaUS8nZCAatItFBvxiFIz571qlTk=; b=NBh07vWGdV7YQvNNM6rZJO1D95dZm6wR44CaG5aHr4UVgKJLw8fLFOSUdAauZwblQE kgWuEI2R76cj+p9Cb+BAMppUicbTMVsiM4xJY10g4nC+nRwW6tfY5jViZV12Gz+dC9Vc lJfCPMIqebxiRN0YmN3526NO7T+fKN400D4Lru7aI59BTT31WsQABBX9aoWznPetCpEJ eyJL1fWEQGF4iY1STQTaHRM0UZYPdp5BnXxd4YdxA3uGKfy03e1yJuQ5ELw/+KqdLmi+ n4kaFaxlRWeMSg95rk5SR12p5fOUy884HQjqo4ZIv3tTOi1meO/01CWzC6c/uxOtBLzM rFHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZAx2+BVK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si6604100edr.154.2020.11.23.04.42.06; Mon, 23 Nov 2020 04:42:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZAx2+BVK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731902AbgKWMhQ (ORCPT + 99 others); Mon, 23 Nov 2020 07:37:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:49290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731865AbgKWMhL (ORCPT ); Mon, 23 Nov 2020 07:37:11 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C5F4420888; Mon, 23 Nov 2020 12:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135031; bh=uAl/Hj/W/wcK0yBx/8xKCDgjvvm9J8Ad/jZllIuEMww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZAx2+BVKvdqGU38wDChYU18546RA1B65r7fdw7icZR8X3USbjuxTXcaBxQ6qxyB4p 1Al2yRgZv7ipu4FgKdOfyL/fTj5dha9BoZ6gA55039H5TkJMLoWL37oSZHNRMbtvYi d1l+DgM/ynvMpHRHc7xXmBkwwIbkWBKG6W4QafXc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Remigiusz=20Ko=C5=82=C5=82=C4=85taj?= , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.4 079/158] can: mcba_usb: mcba_usb_start_xmit(): first fill skb, then pass to can_put_echo_skb() Date: Mon, 23 Nov 2020 13:21:47 +0100 Message-Id: <20201123121823.750193611@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Kleine-Budde [ Upstream commit 81c9c8e0adef3285336b942f93287c554c89e6c6 ] The driver has to first fill the skb with data and then handle it to can_put_echo_skb(). This patch moves the can_put_echo_skb() down, right before sending the skb out via USB. Fixes: 51f3baad7de9 ("can: mcba_usb: Add support for Microchip CAN BUS Analyzer") Cc: Remigiusz Kołłątaj Link: https://lore.kernel.org/r/20201111221204.1639007-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/usb/mcba_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/usb/mcba_usb.c b/drivers/net/can/usb/mcba_usb.c index 21faa2ec46327..8f785c199e220 100644 --- a/drivers/net/can/usb/mcba_usb.c +++ b/drivers/net/can/usb/mcba_usb.c @@ -326,8 +326,6 @@ static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, if (!ctx) return NETDEV_TX_BUSY; - can_put_echo_skb(skb, priv->netdev, ctx->ndx); - if (cf->can_id & CAN_EFF_FLAG) { /* SIDH | SIDL | EIDH | EIDL * 28 - 21 | 20 19 18 x x x 17 16 | 15 - 8 | 7 - 0 @@ -357,6 +355,8 @@ static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, if (cf->can_id & CAN_RTR_FLAG) usb_msg.dlc |= MCBA_DLC_RTR_MASK; + can_put_echo_skb(skb, priv->netdev, ctx->ndx); + err = mcba_usb_xmit(priv, (struct mcba_usb_msg *)&usb_msg, ctx); if (err) goto xmit_failed; -- 2.27.0