From: Leon Romanovsky <leon@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Matan Barak <matanb@mellanox.com>,
Doug Ledford <dledford@redhat.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/cma: Fix the size of a buffer in add_port_entries()
Date: Sat, 23 Sep 2023 21:52:26 +0300 [thread overview]
Message-ID: <20230923185226.GE1642130@unreal> (raw)
In-Reply-To: <91395b73a64c13dfe45c3fd3b088b216ba0c9332.1695449697.git.christophe.jaillet@wanadoo.fr>
On Sat, Sep 23, 2023 at 08:15:25AM +0200, Christophe JAILLET wrote:
> In order to be sure that 'buff' is never truncated, its size should be
> 11, not 10.
>
> When building with W=1, this fixes the following warnings:
>
> drivers/infiniband/core/cma_configfs.c: In function ‘make_cma_ports’:
> drivers/infiniband/core/cma_configfs.c:223:57: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
> 223 | snprintf(port_str, sizeof(port_str), "%u", i + 1);
> | ^
> drivers/infiniband/core/cma_configfs.c:223:17: note: ‘snprintf’ output between 2 and 11 bytes into a destination of size 10
> 223 | snprintf(port_str, sizeof(port_str), "%u", i + 1);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: 045959db65c67 ("IB/cma: Add configfs for rdma_cm")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/infiniband/core/cma_configfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, it was already fixed.
https://lore.kernel.org/all/a7e3b347ee134167fa6a3787c56ef231a04bc8c2.1694434639.git.leonro@nvidia.com/
prev parent reply other threads:[~2023-09-23 18:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-23 6:15 [PATCH] RDMA/cma: Fix the size of a buffer in add_port_entries() Christophe JAILLET
2023-09-23 18:52 ` Leon Romanovsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230923185226.GE1642130@unreal \
--to=leon@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=matanb@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox