Re: [PATCH v4 iwl-next] i40e: Use correct buffer size in i40e_dbg_command_read

From: Kunwu Chan
Date: Thu Dec 07 2023 - 21:05:50 EST


Thanks for the reminder. It was my negligence.

I'll resend the v5 patch:
1. Keep 'Signed-off-by' be the last tag in the block
2. Cc to 'intel-wired-lan@xxxxxxxxxxxxxxxx'
3. Cc to my personal email 'kunwu.chan@xxxxxxxxxxx'

Thanks again,
Kunwu

On 2023/12/8 07:25, Tony Nguyen wrote:


On 12/6/2023 4:40 AM, Alexander Lobakin wrote:
From: Kunwu Chan <chentao@xxxxxxxxxx>
Date: Tue, 5 Dec 2023 17:58:44 +0800

The size of "i40e_dbg_command_buf" is 256, the size of "name"
depends on "IFNAMSIZ", plus a null character and format size,
the total size is more than 256.

Improve readability and maintainability by replacing a hardcoded string
allocation and formatting by the use of the kasprintf() helper.

Fixes: 02e9c290814c ("i40e: debugfs interface")
Signed-off-by: Kunwu Chan <chentao@xxxxxxxxxx>
Suggested-by: Simon Horman <horms@xxxxxxxxxx>
Suggested-by: Alexander Lobakin <aleksander.lobakin@xxxxxxxxx>

Your Signed-off-by must be the last tag in the block.
Perhaps the maintainer could fix it when taking, so that you wouldn't
need to send a new version only due to that.

You missed Intel Wired LAN (intel-wired-lan@xxxxxxxxxxxxxxxx) on this, though the other versions did have it. Could you fix this up and be sure to include Intel Wired LAN?

Thanks,
Tony

---
v2
    - Update the size calculation with IFNAMSIZ and sizeof(i40e_dbg_command_buf)
v3
    - Use kasprintf to improve readability and maintainability
v4
    - Fix memory leak in error path