aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2016-12-03 23:15:44 -0500
committerDavid S. Miller <davem@davemloft.net>2016-12-05 14:48:48 -0500
commitc79e167c3cba066892542f3dfb5e73b7207e01df (patch)
tree2688a8e811b47fff31d7c5ed42e814679b52c8f3 /net
parent0eab121ef8750a5c8637d51534d5e9143fb0633f (diff)
net: caif: remove ineffective check
The check of the return value of sock_register() is ineffective. "if(!err)" seems to be a typo. It is better to propagate the error code to the callers of caif_sktinit_module(). This patch removes the check statment and directly returns the result of sock_register(). Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188751 Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/caif/caif_socket.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index aa209b1066c9..92cbbd2afddb 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -1107,10 +1107,7 @@ static struct net_proto_family caif_family_ops = {
1107 1107
1108static int __init caif_sktinit_module(void) 1108static int __init caif_sktinit_module(void)
1109{ 1109{
1110 int err = sock_register(&caif_family_ops); 1110 return sock_register(&caif_family_ops);
1111 if (!err)
1112 return err;
1113 return 0;
1114} 1111}
1115 1112
1116static void __exit caif_sktexit_module(void) 1113static void __exit caif_sktexit_module(void)