Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp506055pxj; Wed, 2 Jun 2021 04:52:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOJaGL24x1QWv6MsCc9RfK027K7icdSU5H0Jd5qftJSXfnlFgt4mAITKyAOcFH4NnD0GxV X-Received: by 2002:a5d:83da:: with SMTP id u26mr16237977ior.170.1622634758871; Wed, 02 Jun 2021 04:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622634758; cv=none; d=google.com; s=arc-20160816; b=GjWuwUuhr3C3vqFnUBL+c64SWzLlyTEZpUPAYlRnLsq6Qf1RgRRSSwnXpp5iraHU7A qrZvsZ4dwptkuBtUd/8zuVZTOZHlo5Lvi0EztlmkQP1M8Ntq4wRo89xjx/yDxyZ9XzKb o9xl/Ljxn7kLrrgCNGQA30xuePlJkBu7ow+5VGumnobCwlLiwJP/3JeuKCoNKVvjQAEe mSo2ilVEugRadlIryd4MX3vXI09zjnoq2XMoo90MUqvpX6fNgwhGyAcdLT+0A2KGM1at q6IKHw3hMl75sQX+JFaMKrqNCYyxNc2QwgcEV0fXRsrwCbfCZI+6FFiZznporuZPAE7J rK+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=yRbRTLASonIPtpNQAx6meT39NrGuuuTc2PqfOs4azU8=; b=SC/2WRfajHuqRK00MTFrWe8cFPjPM1CClE+nrMNSIr7hdFV3RfNkO3tFntrdZoNr2k qHas2FIMHXX04TVtBKcWsMwZloVm33AG3qUeLrnYDchL4rDPWqL79+HLStRiIxN0jYxy rSmXsXkxJKdGNai8UhOSYmkJv5H2Kvm4cEy37sEdQJMRYnLpclMRq2YPYY5v2YH9xJm+ WthsVW8WbkkP5FnKXsTtnUa3dge9SiVDvRHrBYLmavJTeu7rmsTLeWWJi2bgXVyaYF1d QcqNiXDiqTvUDhtryjsIKfoYoFl6Tf4bhmoire/opzoNiY9jO4/uxPCSt6d86fd9XtMQ cXmA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si1505776ils.51.2021.06.02.04.52.25; Wed, 02 Jun 2021 04:52:38 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231468AbhFBJWa (ORCPT + 99 others); Wed, 2 Jun 2021 05:22:30 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:6137 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbhFBJWa (ORCPT ); Wed, 2 Jun 2021 05:22:30 -0400 Received: from dggeme711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Fw3N90mpKzYq0G; Wed, 2 Jun 2021 17:18:01 +0800 (CST) Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggeme711-chm.china.huawei.com (10.1.199.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 2 Jun 2021 17:20:45 +0800 Received: from dggemi761-chm.china.huawei.com ([10.9.49.202]) by dggemi761-chm.china.huawei.com ([10.9.49.202]) with mapi id 15.01.2176.012; Wed, 2 Jun 2021 17:20:45 +0800 From: "Song Bao Hua (Barry Song)" To: Greg KH , "tiantao (H)" CC: Andy Shevchenko , "tiantao (H)" , Linux Kernel Mailing List , Andrew Morton , Andy Shevchenko , "Rafael J. Wysocki" , Jonathan Cameron Subject: RE: [PATCH 1/2] topology: use bin_attribute to avoid buff overflow Thread-Topic: [PATCH 1/2] topology: use bin_attribute to avoid buff overflow Thread-Index: AQHXVpHLdxqqXqYHy0SNrz7+ZdO1FKr+ElmAgAGnloCAAAEPgIAAArSAgAAnIwCAAANUAIAAAbOAgACIVwA= Date: Wed, 2 Jun 2021 09:20:45 +0000 Message-ID: <547f8273faa146699dd50173b33f03e2@hisilicon.com> References: <1622516210-10886-1-git-send-email-tiantao6@hisilicon.com> <1622516210-10886-2-git-send-email-tiantao6@hisilicon.com> <4c9c7c17-e8d1-d601-6262-8064293a06a9@huawei.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.202.102] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogR3JlZyBLSCBbbWFpbHRv OmdyZWdraEBsaW51eGZvdW5kYXRpb24ub3JnXQ0KPiBTZW50OiBXZWRuZXNkYXksIEp1bmUgMiwg MjAyMSA5OjA2IFBNDQo+IFRvOiB0aWFudGFvIChIKSA8dGlhbnRhbzZAaGlzaWxpY29uLmNvbT4N Cj4gQ2M6IEFuZHkgU2hldmNoZW5rbyA8YW5keS5zaGV2Y2hlbmtvQGdtYWlsLmNvbT47IHRpYW50 YW8gKEgpDQo+IDx0aWFudGFvNkBoaXNpbGljb24uY29tPjsgTGludXggS2VybmVsIE1haWxpbmcg TG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