Patch "RDMA/mlx4: Fix truncated output warning in mad.c" has been added to the 4.19-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    RDMA/mlx4: Fix truncated output warning in mad.c

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rdma-mlx4-fix-truncated-output-warning-in-mad.c.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b964a1011916e82fda0e334e251cf04b283a959b
Author: Leon Romanovsky <leon@xxxxxxxxxx>
Date:   Sun Jun 16 19:16:33 2024 +0300

    RDMA/mlx4: Fix truncated output warning in mad.c
    
    [ Upstream commit 0d2e6992fc956e3308cd5376c18567def4cb3967 ]
    
    Increase size of the name array to avoid truncated output warning.
    
    drivers/infiniband/hw/mlx4/mad.c: In function ‘mlx4_ib_alloc_demux_ctx’:
    drivers/infiniband/hw/mlx4/mad.c:2197:47: error: ‘%d’ directive output
    may be truncated writing between 1 and 11 bytes into a region of size 4
    [-Werror=format-truncation=]
     2197 |         snprintf(name, sizeof(name), "mlx4_ibt%d", port);
          |                                               ^~
    drivers/infiniband/hw/mlx4/mad.c:2197:38: note: directive argument in
    the range [-2147483645, 2147483647]
     2197 |         snprintf(name, sizeof(name), "mlx4_ibt%d", port);
          |                                      ^~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/mad.c:2197:9: note: ‘snprintf’ output between
    10 and 20 bytes into a destination of size 12
     2197 |         snprintf(name, sizeof(name), "mlx4_ibt%d", port);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/mad.c:2205:48: error: ‘%d’ directive output
    may be truncated writing between 1 and 11 bytes into a region of size 3
    [-Werror=format-truncation=]
     2205 |         snprintf(name, sizeof(name), "mlx4_ibwi%d", port);
          |                                                ^~
    drivers/infiniband/hw/mlx4/mad.c:2205:38: note: directive argument in
    the range [-2147483645, 2147483647]
     2205 |         snprintf(name, sizeof(name), "mlx4_ibwi%d", port);
          |                                      ^~~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/mad.c:2205:9: note: ‘snprintf’ output between
    11 and 21 bytes into a destination of size 12
     2205 |         snprintf(name, sizeof(name), "mlx4_ibwi%d", port);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/mad.c:2213:48: error: ‘%d’ directive output
    may be truncated writing between 1 and 11 bytes into a region of size 3
    [-Werror=format-truncation=]
     2213 |         snprintf(name, sizeof(name), "mlx4_ibud%d", port);
          |                                                ^~
    drivers/infiniband/hw/mlx4/mad.c:2213:38: note: directive argument in
    the range [-2147483645, 2147483647]
     2213 |         snprintf(name, sizeof(name), "mlx4_ibud%d", port);
          |                                      ^~~~~~~~~~~~~
    drivers/infiniband/hw/mlx4/mad.c:2213:9: note: ‘snprintf’ output between
    11 and 21 bytes into a destination of size 12
     2213 |         snprintf(name, sizeof(name), "mlx4_ibud%d", port);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make[6]: *** [scripts/Makefile.build:244: drivers/infiniband/hw/mlx4/mad.o] Error 1
    
    Fixes: fc06573dfaf8 ("IB/mlx4: Initialize SR-IOV IB support for slaves in master context")
    Link: https://lore.kernel.org/r/f3798b3ce9a410257d7e1ec7c9e285f1352e256a.1718554569.git.leon@xxxxxxxxxx
    Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
index 418b9312fb2d7..a034cb3fa7cad 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -2158,7 +2158,7 @@ static int mlx4_ib_alloc_demux_ctx(struct mlx4_ib_dev *dev,
 				       struct mlx4_ib_demux_ctx *ctx,
 				       int port)
 {
-	char name[12];
+	char name[21];
 	int ret = 0;
 	int i;
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux