From 7e8d7e3c9e38dab8d28a8667faa4941842f64213 Mon Sep 17 00:00:00 2001 From: "KAMBAROV, ZAUR" Date: Thu, 7 Jul 2005 17:57:07 -0700 Subject: [PATCH] [PATCH] coverity: sunrpc/xprt task null check In __xprt_lock_write() we check to see if `task' is NULL, but in other places we just go and dereference it. `task' shouldn't be NULL anyway, so remove this test. This defect was found automatically by Coverity Prevent, a static analysis tool. Signed-off-by: Zaur Kambarov Acked-by: Trond Myklebust Cc: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- net/sunrpc/xprt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 269f217918a3..3c654e06b084 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -145,8 +145,6 @@ __xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task) if (test_and_set_bit(XPRT_LOCKED, &xprt->sockstate)) { if (task == xprt->snd_task) return 1; - if (task == NULL) - return 0; goto out_sleep; } if (xprt->nocong || __xprt_get_cong(xprt, task)) { -- 2.30.2