From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
"J. Bruce Fields" <bfields@fieldses.org>,
Trond Myklebust <trond.myklebust@primarydata.com>
Cc: "David S. Miller" <davem@davemloft.net>,
linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix for possible null pointer dereference in auth.c
Date: Fri, 16 May 2014 16:19:39 +0400 [thread overview]
Message-ID: <5376025B.6010202@cogentembedded.com> (raw)
In-Reply-To: <1400190998-28153-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
Hello.
On 16-05-2014 1:56, Rickard Strandqvist wrote:
> 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
} and *else* should be on the same line, and there should be {} in the
*else* arm since there's {} in the *if* arm already, according to
Documentation/CodingStyle.
> + dprintk("RPC: %5u invalidating is NULL\n", task->tk_pid);
That's not a proper English, I'm afraid.
> }
WBR, Sergei
next prev parent reply other threads:[~2014-05-16 12:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2014-05-17 16:36 ` Rickard Strandqvist
[not found] ` <CAFo99gatLzLpOu92N23bMQ=a25BTnK3QK2rAzoQJcU3oxMuMgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-17 17:17 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5376025B.6010202@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=bfields@fieldses.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=trond.myklebust@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).