Skip to content
Commit b13559b7 authored by Rahul Rameshbabu's avatar Rahul Rameshbabu Committed by Saeed Mahameed
Browse files

net/mlx5e: Correct snprintf truncation handling for fw_version buffer used by representors

snprintf returns the length of the formatted string, excluding the trailing
null, without accounting for truncation. This means that is the return
value is greater than or equal to the size parameter, the fw_version string
was truncated.

Link: https://docs.kernel.org/core-api/kernel-api.html#c.snprintf
Fixes: 1b2bd0c0

 ("net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors")
Signed-off-by: default avatarRahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent ad436b9c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment