Re: [PATCH net] net/mlx5e: Fix snprintf return check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 27 Nov, 2023 16:00:53 +0300 Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> This code prints a string and then if there wasn't enough space for the
> whole string, then it prints a slightly shorter string.  However, the
> test for overflow should have been >= instead of == because snprintf()
> returns the number of bytes which *would* have been printed if there
> were enough space.
>
> Fixes: 41e63c2baa11 ("net/mlx5e: Check return value of snprintf writing to fw_version buffer")
> Fixes: 1b2bd0c0264f ("net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---

I have already sent out patches targeting net for this on the mailing
list. That said, thanks for the follow-up.

  * https://lore.kernel.org/netdev/20231121230022.89102-1-rrameshbabu@xxxxxxxxxx/
  * https://lore.kernel.org/netdev/20231121230022.89102-2-rrameshbabu@xxxxxxxxxx/

These have been reviewed by Simon Horman.

--
Thanks,

Rahul Rameshbabu




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux