Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp62303rwn; Wed, 7 Sep 2022 20:07:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ZyWAbnmr646Qey1puPIXqZPr/aGjTb91MugpK7J0Hr5RWRHX0n824/uQJvxb4RQsf+coj X-Received: by 2002:a17:902:c410:b0:177:82b6:e6ed with SMTP id k16-20020a170902c41000b0017782b6e6edmr5242617plk.27.1662606478524; Wed, 07 Sep 2022 20:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662606478; cv=none; d=google.com; s=arc-20160816; b=eIMYzJ78j/r29CE9mezmbNUOkYM5+7Ys+NyddboRmoUKL+9hc+4hC0kN0lk7RD9aID pwH4QC7t+Z1Udcuk2+w1SwE7GmGP/PLoKYm5ROAWjWbpOpyZSW/RjGQzxCBwSMeU+fjC TCqchF4rihJR4b2w4z4WWX+Pd3uJlmQeXewYSx3AxXngaWgUJ2Am+TR6nEkhJKzmpjP/ 5diy9nLHhrda9v2IetYjMxmcgbW8u2V1XEwTGemKVzCwhi115o66fj6hmvnUvsrOXiYU o1hjWJPnOIcSSJ+eWwm/U+SXiGhfweqthUZcNmqU30PAQCoLx+2H6Dnz37MxWOUch+3J 3b7A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=y7Tn06pexl1hrEl8jyE1cVLxej/eJ1KO6FxQlVzINEs=; b=vBNYTGCq+ptNtRSYkgd3i/mXt/G+vgHtODR1unnHF4RAie+QTEcz2naVu1LhDXRN/L bMKrltK4omWUD4z1VTtEG0wXBjguHv40IrCPF1LeT42GJ9ib2z6N1gBCWD2knbVGi4FE ecP3eapX7I6+DM4wX8XKrLiOx3h8rJiILX8P8kU1MnhwOTN59S4phL62tzDPB6pwe6mm N18E58r3gQ8eycRTkS4sYig/mkQHD2YIjsU0wjLJDkLvsdMFhw/3FBd6u1ysXS/CSVZW HrAwP6RS5t7CSFfOM/9v2b3Qk9YPpKYhKnlEm7KmvvcFa4daF2B6bKjwWnpg9Y+tQbV/ 1JtA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb14-20020a17090ae7ce00b001f541fc751fsi1034017pjb.190.2022.09.07.20.07.47; Wed, 07 Sep 2022 20:07:58 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbiIHDEz (ORCPT + 99 others); Wed, 7 Sep 2022 23:04:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229651AbiIHDEg (ORCPT ); Wed, 7 Sep 2022 23:04:36 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B92655A1; Wed, 7 Sep 2022 20:04:28 -0700 (PDT) Received: from canpemm500006.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MNP5H0zwfzmVFG; Thu, 8 Sep 2022 11:00:51 +0800 (CST) Received: from localhost.localdomain (10.175.104.82) by canpemm500006.china.huawei.com (7.192.105.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 8 Sep 2022 11:04:26 +0800 From: Ziyang Xuan To: , , , , , CC: Subject: [PATCH 2/2] can: bcm: check the result of can_send() in bcm_can_tx() Date: Thu, 8 Sep 2022 11:04:20 +0800 Message-ID: <5c0f2f1bd1dc7bbb9500afd4273e36378e00a35d.1662606045.git.william.xuanziyang@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.82] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500006.china.huawei.com (7.192.105.130) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 If can_send() fail, it should not update statistics in bcm_can_tx(). Add the result check for can_send() in bcm_can_tx(). Fixes: ffd980f976e7 ("[CAN]: Add broadcast manager (bcm) protocol") Signed-off-by: Ziyang Xuan --- net/can/bcm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/can/bcm.c b/net/can/bcm.c index e2783156bfd1..8f5d704a409f 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c @@ -298,7 +298,8 @@ static void bcm_can_tx(struct bcm_op *op) /* send with loopback */ skb->dev = dev; can_skb_set_owner(skb, op->sk); - can_send(skb, 1); + if (can_send(skb, 1)) + goto out; /* update statistics */ op->currframe++; -- 2.25.1