Skip to contentSkip to conversation

RDMA/iwpm: Remove redundant initialization of pointer err_str

PATCH Applied Colin King 2 participants 2 messages Oct 7, 2021 – Oct 12, 2021

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 RDMA/iwpm: Remove redundant initialization of pointer err_str

From: Colin Ian King <[email protected]>

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.

Addresses-Coverity: ("Unused value")

---
 drivers/infiniband/core/iwpm_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/iwpm_util.c +1 -1
index 54f4feb604d8..358a2db38d23 100644
@@ -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);
Signature · 1 line
2.32.0
maintainer Applied
#1 lore raw
Quoted 11 lines · Colin King

From: Colin Ian King <[email protected]>

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.

Addresses-Coverity: ("Unused value")

---
 drivers/infiniband/core/iwpm_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason