Received: by 10.213.65.68 with SMTP id h4csp506488imn; Wed, 4 Apr 2018 02:16:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+7KYoF4jb9z4lhWn2AWEYQxGN88IUJAxT89rTfV4O+TS7nRmH1tWeDGKJrBFnvA1iGf68J X-Received: by 10.98.15.92 with SMTP id x89mr13328068pfi.7.1522833393566; Wed, 04 Apr 2018 02:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522833393; cv=none; d=google.com; s=arc-20160816; b=CrigO36hOswmG5Mn3tJy0kqIkW5TNN6PNjCoycT3A4pIifE+PqIn3Cl9PR63zRt6Qu k+uyCL3ScPa0Jn2Ltgs/PJvNzxMI03vf8BxAanW9X2FewTyIl4Saj2g7tWTFGrJ9mWIc WWyh9kSWQ/begNIT2xUdr20Eg6nsbXlFV0o/KNdBIGWTPFU0arqf71hgrhFKSJxjyn14 Zhkh1pnk4WvgMgvSSuSa3I7tF5edCbBQa+3/JNQw+mxFahAZSDE3QXV5jpwIi9GfCag2 e7VZBzwyvtCAVt0CNGDMJABE8nCuGEA4AVSYcroZutCr4s3+JbQww8FvG2MQ6SEG/IgV 3KwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=qHoj7zS2YOsOUeTPcZ5gVA7gmQRemzE6TjP1bkSkgdQ=; b=XfUBIguE+I1STUZiF4USAVs9liBhH7Z5PoAeKYafzHw/ipwowrzbguK0KaOVhmIW55 dyA0WX+cyr5sXZXD0ThRTTk4j89TW8501Xs+4f/r/5VAdQq5QHdbxZm3tNIrkkZP+84V LhVMD+1bqP5c4ctw7e0vaPRkfQNp67WfPeJ9GGDkz+tGP5mIHpg81rfFTn6t+IIBwstY rvP2a6+soeHG6vtKgjFq2DgdoF00nlpMV5IcoxM4u4Hmwb7MVtuIe1H+pegJWieE9H18 9llj9uVqJNA8uqcGNChWboHm4BF49wukBNYU30HSAsrz89ao2uUZiZUQdqXjZfbsiXnM KRxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11-v6si2939168plm.19.2018.04.04.02.16.19; Wed, 04 Apr 2018 02:16:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751482AbeDDJOn (ORCPT + 99 others); Wed, 4 Apr 2018 05:14:43 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7151 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751306AbeDDJOm (ORCPT ); Wed, 4 Apr 2018 05:14:42 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A344640983B5D; Wed, 4 Apr 2018 17:14:27 +0800 (CST) Received: from huawei.com (10.175.102.38) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.361.1; Wed, 4 Apr 2018 17:14:21 +0800 From: Tan Xiaojun To: , CC: , , , , , Subject: [PATCH] net: hns3: fix length overflow when CONFIG_ARM64_64K_PAGES Date: Wed, 4 Apr 2018 17:40:48 +0800 Message-ID: <1522834848-63974-1-git-send-email-tanxiaojun@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.38] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When enable the config item "CONFIG_ARM64_64K_PAGES", the size of PAGE_SIZE is 65536(64K). But the type of length is u16, it will overflow. So change it to u32. Signed-off-by: Tan Xiaojun --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h index 9e4cfbb..98cdbd3 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h @@ -288,7 +288,7 @@ struct hns3_desc_cb { u16 page_offset; u16 reuse_flag; - u16 length; /* length of the buffer */ + u32 length; /* length of the buffer */ /* desc type, used by the ring user to mark the type of the priv data */ u16 type; -- 2.7.4