From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Pan Bian <bianpan2016@163.com>,
Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] net: caif: fix ineffective error check
Date: Sat, 3 Dec 2016 16:17:51 +0300 [thread overview]
Message-ID: <f214a441-9e4b-6c40-f09d-32a6d1ea4dd0@cogentembedded.com> (raw)
In-Reply-To: <1480763901-5323-1-git-send-email-bianpan2016@163.com>
Hello.
On 12/3/2016 2:18 PM, Pan Bian wrote:
> In function caif_sktinit_module(), the check of the return value of
> sock_register() seems ineffective. This patch fixes it.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188751
>
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
> net/caif/caif_socket.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
> index aa209b1..2a689a3 100644
> --- a/net/caif/caif_socket.c
> +++ b/net/caif/caif_socket.c
> @@ -1108,7 +1108,7 @@ static int caif_create(struct net *net, struct socket *sock, int protocol,
> static int __init caif_sktinit_module(void)
> {
> int err = sock_register(&caif_family_ops);
> - if (!err)
> + if (err)
> return err;
Why not just:
return sock_register(&caif_family_ops);
> return 0;
> }
MBR, Sergei
next prev parent reply other threads:[~2016-12-03 13:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-03 11:18 [PATCH 1/1] net: caif: fix ineffective error check Pan Bian
2016-12-03 13:17 ` Sergei Shtylyov [this message]
2016-12-03 15:38 ` Pan Bian
2016-12-03 21:05 ` Sergei Shtylyov
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=f214a441-9e4b-6c40-f09d-32a6d1ea4dd0@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=bianpan2016@163.com \
--cc=davem@davemloft.net \
--cc=dmitry.tarnyagin@lockless.no \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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).