]> git.ipfire.org Git - thirdparty/iproute2.git/commit
rdma: make RES_PID and RES_KERN_NAME alternative to each other
authorAndrea Claudi <aclaudi@redhat.com>
Tue, 8 Mar 2022 17:04:57 +0000 (18:04 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Sat, 12 Mar 2022 03:16:50 +0000 (19:16 -0800)
commitac0a54b2d5db0298baab935f555fd092c4b6cb69
treecffacf5b6dfff904c697398ceb0bd560693431ef
parent885e281eadc238e30f7c3a42ad366ea123c03a83
rdma: make RES_PID and RES_KERN_NAME alternative to each other

RDMA_NLDEV_ATTR_RES_PID and RDMA_NLDEV_ATTR_RES_KERN_NAME cannot be set
together, as evident for the fill_res_name_pid() function in the kernel
infiniband driver. This commit makes this clear at first glance, using
an else branch for the RDMA_NLDEV_ATTR_RES_KERN_NAME case.

This also helps coverity to better understand this code and avoid
producing a bogus warning complaining about mnl_attr_get_str overwriting
comme, and thus leaking the storage that comm points to.

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
rdma/res-cmid.c
rdma/res-cq.c
rdma/res-ctx.c
rdma/res-mr.c
rdma/res-pd.c
rdma/res-qp.c
rdma/res-srq.c
rdma/stat.c