Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435AbcLCLer (ORCPT ); Sat, 3 Dec 2016 06:34:47 -0500 Received: from m50-132.163.com ([123.125.50.132]:34931 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751176AbcLCLeq (ORCPT ); Sat, 3 Dec 2016 06:34:46 -0500 From: Pan Bian To: Dmitry Tarnyagin , "David S. Miller" , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Pan Bian Subject: [PATCH 1/1] net: caif: fix ineffective error check Date: Sat, 3 Dec 2016 19:18:21 +0800 Message-Id: <1480763901-5323-1-git-send-email-bianpan2016@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: DNGowABnDPH8qUJYVDoQIQ--.63492S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrZr4kCw17uFyDAw13tryfCrg_yoW3Xrb_Cr yUJa1UK3Wktr4Fk3y5C398XF9Ygrs5XFsaqr47Ja42gw1xWryYvrs7CF9xAF1rWryIkryU Wrn5JF9Iqw47ujkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUn6OJ7UUUUU== X-Originating-IP: [222.131.246.88] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/1tbiDgA1clXlhmgeWQAAsQ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 719 Lines: 26 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 --- 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; return 0; } -- 1.9.1