netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix for possible null pointer dereference in auth.c
@ 2014-05-15 21:56 Rickard Strandqvist
       [not found] ` <1400190998-28153-1-git-send-email-rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org>
  2014-05-16 12:19 ` Sergei Shtylyov
  0 siblings, 2 replies; 6+ messages in thread
From: Rickard Strandqvist @ 2014-05-15 21:56 UTC (permalink / raw)
  To: J. Bruce Fields, Trond Myklebust
  Cc: Rickard Strandqvist, David S. Miller, linux-nfs, netdev,
	linux-kernel

There is otherwise a risk of a possible null pointer dereference.

Was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 net/sunrpc/auth.c |   10 +++++++---
 1 fil ändrad, 7 tillägg(+), 3 borttagningar(-)

diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 5285ead..3a55698 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -801,10 +801,14 @@ rpcauth_invalcred(struct rpc_task *task)
 {
 	struct rpc_cred *cred = task->tk_rqstp->rq_cred;
 
-	dprintk("RPC: %5u invalidating %s cred %p\n",
-		task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
-	if (cred)
+	if (cred) {
+		dprintk("RPC: %5u invalidating %s cred %p\n",
+			task->tk_pid, cred->cr_auth->au_ops->au_name, cred);
+
 		clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
+	}
+	else
+		dprintk("RPC: %5u invalidating is NULL\n", task->tk_pid);
 }
 
 int
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-17 17:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-15 21:56 [PATCH] Fix for possible null pointer dereference in auth.c Rickard Strandqvist
     [not found] ` <1400190998-28153-1-git-send-email-rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org>
2014-05-15 22:07   ` Trond Myklebust
2014-05-15 22:10     ` Rickard Strandqvist
2014-05-16 12:19 ` Sergei Shtylyov
2014-05-17 16:36   ` Rickard Strandqvist
     [not found]     ` <CAFo99gatLzLpOu92N23bMQ=a25BTnK3QK2rAzoQJcU3oxMuMgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-17 17:17       ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).