lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <dc1ba294-233a-4308-81df-23783487b817@app.fastmail.com>
Date:   Mon, 04 Dec 2023 09:52:58 +0100
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Jijie Shao" <shaojijie@...wei.com>,
        "Arnd Bergmann" <arnd@...nel.org>,
        "Yisen Zhuang" <yisen.zhuang@...wei.com>,
        "Salil Mehta" <salil.mehta@...wei.com>,
        "David S . Miller" <davem@...emloft.net>,
        "Eric Dumazet" <edumazet@...gle.com>,
        "Jakub Kicinski" <kuba@...nel.org>,
        "Paolo Abeni" <pabeni@...hat.com>
Cc:     "Hao Chen" <chenhao418@...wei.com>,
        Netdev <netdev@...r.kernel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: hns3: reduce stack usage in hclge_dbg_dump_tm_pri()

On Mon, Dec 4, 2023, at 09:31, Jijie Shao wrote:
> on 2023/12/4 15:29, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@...db.de>
>>
>>
>> @@ -981,7 +981,7 @@ static const struct hclge_dbg_item tm_pri_items[] = {
>>   
>>   static int hclge_dbg_dump_tm_pri(struct hclge_dev *hdev, char *buf, int len)
>>   {
>> -	char data_str[ARRAY_SIZE(tm_pri_items)][HCLGE_DBG_DATA_STR_LEN];
>> +	char *data_str;
>>   	struct hclge_tm_shaper_para c_shaper_para, p_shaper_para;
>>   	char *result[ARRAY_SIZE(tm_pri_items)], *sch_mode_str;
>>   	char content[HCLGE_DBG_TM_INFO_LEN];
>> @@ -991,9 +991,13 @@ static int hclge_dbg_dump_tm_pri(struct hclge_dev *hdev, char *buf, int len)
>>   	ret = hclge_tm_get_pri_num(hdev, &pri_num);
>>   	if (ret)
>>   		return ret;
>
> Thanks,
>   But it would be better if there is an empty line here.

ok

>
> all exception condition also need to free memory before return. eg:


Indeed, I'll send a v2 in a bit.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ