OSDN Git Service

RDMA/iwpm: Remove redundant initialization of pointer err_str
authorColin Ian King <colin.king@canonical.com>
Thu, 7 Oct 2021 17:39:42 +0000 (18:39 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 12 Oct 2021 16:11:46 +0000 (13:11 -0300)
The pointer err_str is being initialized with a value that is never read,
it is being updated later on. The assignment is redundant and can be
removed.

Link: https://lore.kernel.org/r/20211007173942.21933-1-colin.king@canonical.com
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/iwpm_util.c

index 54f4feb..358a2db 100644 (file)
@@ -762,7 +762,7 @@ int iwpm_send_hello(u8 nl_client, int iwpm_pid, u16 abi_version)
 {
        struct sk_buff *skb = NULL;
        struct nlmsghdr *nlh;
-       const char *err_str = "";
+       const char *err_str;
        int ret = -EINVAL;
 
        skb = iwpm_create_nlmsg(RDMA_NL_IWPM_HELLO, &nlh, nl_client);