linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Or Har-Toov <ohartoov@nvidia.com>,
	linux-rdma@vger.kernel.org,
	Michael Guralnik <michaelgur@nvidia.com>
Subject: Re: [PATCH rdma-next 1/4] RDMA/nldev: Use __nlmsg_put instead nlmsg_put
Date: Sun, 13 Nov 2022 09:19:59 +0200	[thread overview]
Message-ID: <Y3Cany776/OrEpbY@unreal> (raw)
In-Reply-To: <Y2v8UsT015iiRuob@nvidia.com>

On Wed, Nov 09, 2022 at 03:15:30PM -0400, Jason Gunthorpe wrote:
> On Mon, Nov 07, 2022 at 10:51:33AM +0200, Leon Romanovsky wrote:
> > From: Or Har-Toov <ohartoov@nvidia.com>
> > 
> > Using nlmsg_put causes static analysis tools to many
> > false positives of not checking the return value of nlmsg_put.
> > 
> > In all uses in nldev.c, payload parameter is 0 so NULL will never
> > be returned. So let's use __nlmsg_put function to silence the
> > warnings.
> 
> I'd rather just add useless checks for the errors than call a private
> function like this. Or add some nlmsg_put_no_payload() that can't fail

This is exactly what __nlmsg_put() means. Function that can't fail.

Thanks

> 
> Jason

  reply	other threads:[~2022-11-13  7:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07  8:51 [PATCH rdma-next 0/4] Various core fixes Leon Romanovsky
2022-11-07  8:51 ` [PATCH rdma-next 1/4] RDMA/nldev: Use __nlmsg_put instead nlmsg_put Leon Romanovsky
2022-11-09 19:15   ` Jason Gunthorpe
2022-11-13  7:19     ` Leon Romanovsky [this message]
2022-11-14 14:17       ` Jason Gunthorpe
2022-11-15  7:52         ` Leon Romanovsky
2022-11-07  8:51 ` [PATCH rdma-next 2/4] RDMA/restrack: Release MR restrack when delete Leon Romanovsky
2022-11-09 19:08   ` Jason Gunthorpe
2022-11-10  9:35     ` Leon Romanovsky
2022-11-10 19:29       ` Jason Gunthorpe
2022-11-10 19:39         ` Leon Romanovsky
2022-11-10 19:47           ` Jason Gunthorpe
2022-11-07  8:51 ` [PATCH rdma-next 3/4] RDMA/core: Make sure "ib_port" is valid when access sysfs node Leon Romanovsky
2022-11-07  8:51 ` [PATCH rdma-next 4/4] RDMA/nldev: Return "-EAGAIN" if the cm_id isn't from expected port Leon Romanovsky
2022-11-15  7:59 ` [PATCH rdma-next 0/4] Various core fixes Leon Romanovsky
2022-11-15  7:59 ` (subset) " Leon Romanovsky

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=Y3Cany776/OrEpbY@unreal \
    --to=leon@kernel.org \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=michaelgur@nvidia.com \
    --cc=ohartoov@nvidia.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;
as well as URLs for NNTP newsgroup(s).