Skip to content

Commit

Permalink
net: caif: remove ineffective check
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
SinkFinder authored and davem330 committed Dec 5, 2016
1 parent 0eab121 commit c79e167
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/caif/caif_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,10 +1107,7 @@ static struct net_proto_family caif_family_ops = {

static int __init caif_sktinit_module(void)
{
int err = sock_register(&caif_family_ops);
if (!err)
return err;
return 0;
return sock_register(&caif_family_ops);
}

static void __exit caif_sktexit_module(void)
Expand Down

0 comments on commit c79e167

Please sign in to comment.