Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3389622lkq; Mon, 23 Nov 2020 04:35:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyV/5g3LfWBmv22jyeU4chxZ3mQGqNkwnLxmJ+wT3PFexvJdPC70IhUKmm9r/upGHjJ3P59 X-Received: by 2002:aa7:df89:: with SMTP id b9mr47851803edy.335.1606134920417; Mon, 23 Nov 2020 04:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606134920; cv=none; d=google.com; s=arc-20160816; b=sNvA59q3cCVWK5lMp3omnXWPCsrmMh2nivUCjNFPkVOFSq/deotdAmlLMOKGiQXnle LlX1F+t9E7RTxbRnb4aa4u4MS7s4j5YIEjnPDDpU3gMTkuAU43vb9vzJuUDiMT1wOkaV DtG2T2S/TJV+8FlagMMUgKtjaJuVIe+mgSW5yFktG7r0xyJ9+phctcML9OEREvhl0ECd Pn8fkkjrP2QHzyWVIY+z6BZ6/4o23Lo9ZFnl2yPp0pxP3BSjpv9zQBeTdBYW+LXflse6 b3j5znCOCkptTgb6gCTtmcuqzfAtIZv1c5wDbH82mwa6+a1helmH7Hitk17Dvoa8PTq8 bKkw== 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=2ptGkzbNahaVwM+kZsSrhFetIK/SFTLS3reJM+sstXs=; b=teN/JMnX87c4sPt3N4mJnLuEocwQtLH6VADM9/Ydit2ilzXUF74pxRjhybB1KTqkRT fO7WLrd/3HfLgDFuq2Iq4m/ppChUNqBrCTiTfZvfHJzbJMvj/STqQgdBpSEDtQrGf4H6 HU5mwEW8xMnRPo5y24rNy2zl5fTbNZUQofnztCCY01YVLHHX8KUHB1s3cnIuTOqVZ3s5 pknqEyWNa/3LxT97jJC5AQsdkn1C05roP6e40HdqNahcpdi6kDHfB7AkN6OtYHptrDb4 IwfSQwqfVOMOq+NYxyNcgPxvO3vTkZFEtMt1poklpVW5X2NgAa9y5dg1Xlz14HWHRWqk uRAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r61iYQx1; 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 z8si3195616edq.315.2020.11.23.04.34.57; Mon, 23 Nov 2020 04:35:20 -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=r61iYQx1; 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 S1731009AbgKWMcH (ORCPT + 99 others); Mon, 23 Nov 2020 07:32:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:42860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730916AbgKWMbm (ORCPT ); Mon, 23 Nov 2020 07:31:42 -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 5A4C520781; Mon, 23 Nov 2020 12:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134701; bh=2SJF0xW/s368wSUMH5FRjmo7TsU0/ZJWqMCftbMkCu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r61iYQx1ZCFRR74/xs7VfcIi515yE+Pj0XVU3ywVwtoD2uOs29bAQJlxenmB9dYQX fUinJ9W3LqliE1aeuAxiTgoQ+cGndoV5rQ2ro9fjRul34vgf2PwmrT4mNB2oH7Lcwy OULl6/RioztyzYMZ4xLWKyfME2M/FXs2b/rbLbtg= 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 4.19 52/91] can: mcba_usb: mcba_usb_start_xmit(): first fill skb, then pass to can_put_echo_skb() Date: Mon, 23 Nov 2020 13:22:12 +0100 Message-Id: <20201123121811.850807835@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121809.285416732@linuxfoundation.org> References: <20201123121809.285416732@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 1b0afeaf1a3c2..896f5b0227295 100644 --- a/drivers/net/can/usb/mcba_usb.c +++ b/drivers/net/can/usb/mcba_usb.c @@ -337,8 +337,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 @@ -368,6 +366,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