[<prev] [next>] [day] [month] [year] [list]
Message-ID: <51828687.7040605@stud.fit.vutbr.cz>
Date: Thu, 02 May 2013 17:30:15 +0200
From: Radmila Kompová <xkompo00@...d.fit.vutbr.cz>
To: linux-nfs@...r.kernel.org
CC: linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] net/sunrpc/auth.c: move NULL check in rpcauth_invalcred()
before first dereference
Detected by cppcheck.
Signed-off-by: Kamil Dudka <kdudka@...hat.com>
---
net/sunrpc/auth.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index ed2fdd2..cba5529 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -767,11 +767,12 @@ void
rpcauth_invalcred(struct rpc_task *task)
{
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
+ if (!cred)
+ return;
dprintk("RPC: %5u invalidating %s cred %p\n",
task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
- if (cred)
- clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
+ clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
}
int
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists