2024-02-11 15:12:11

by Daniil Dulov

[permalink] [raw]
Subject: [PATCH] w1: remove redundant NULL check

cmd cannot be null in w1_process_cb, thus remove redundant NULL check

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 9fcbbac5ded4 ("w1: process w1 netlink commands in w1_process thread")
Signed-off-by: Daniil Dulov <[email protected]>
---
drivers/w1/w1_netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c
index fa490aa4407c..402065a0432d 100644
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -475,7 +475,7 @@ static void w1_process_cb(struct w1_master *dev, struct w1_async_cmd *async_cmd)
mlen -= len;
}

- if (!cmd || err)
+ if (err)
w1_netlink_queue_status(node->block, node->msg, cmd, err);

/* ref taken in w1_search_slave or w1_search_master_id when building
--
2.25.1