[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9288204E-F6B7-4C9D-AADB-511A845A2624@linux.dev>
Date: Tue, 1 Apr 2025 21:51:27 +0200
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Alex Elder <elder@...e.org>
Cc: Viresh Kumar <vireshk@...nel.org>,
Johan Hovold <johan@...nel.org>,
Alex Elder <elder@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
greybus-dev@...ts.linaro.org,
linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: greybus: Remove unnecessary NUL-termination
checks
On 1. Apr 2025, at 01:31, Alex Elder wrote:
> On 3/31/25 1:39 PM, Thorsten Blum wrote:
>> @@ -125,16 +125,6 @@ static int fw_mgmt_interface_fw_version_operation(struct fw_mgmt *fw_mgmt,
>> strscpy_pad(fw_info->firmware_tag, response.firmware_tag);
>> - /*
>> - * The firmware-tag should be NULL terminated, otherwise throw error but
>> - * don't fail.
>> - */
>> - if (fw_info->firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] != '\0') {
>> - dev_err(fw_mgmt->parent,
>> - "fw-version: firmware-tag is not NULL terminated\n");
>> - fw_info->firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] = '\0';
>> - }
>
> Interesting this didn't return an error, while others below did.
Should I keep it that way when checking for a truncated firmware tag or
should this also fail like the others?
Thanks,
Thorsten
Powered by blists - more mailing lists