From patchwork Sun Dec 30 15:24:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 10745111 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CBF4D746 for ; Sun, 30 Dec 2018 15:24:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE1E9289A6 for ; Sun, 30 Dec 2018 15:24:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0DE428AE3; Sun, 30 Dec 2018 15:24:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 251B4289A6 for ; Sun, 30 Dec 2018 15:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726216AbeL3PYp (ORCPT ); Sun, 30 Dec 2018 10:24:45 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:52906 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbeL3PYp (ORCPT ); Sun, 30 Dec 2018 10:24:45 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBUFNtSY072223; Sun, 30 Dec 2018 15:24:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=IhPK3yhDuohFwWQceVFBGIXsVZwUJNOMmwP7Fn7TP/c=; b=z+ThLVoj+6xYmOsKHDnDSW+Fzc1mZ+Im9CuUjYE1ZlwUVWRY6nQ6baRzBMW2NKK5yqYt AfgG+tYTnn0Q618HnXiUbudqMna9i001hQABKc0lvwfvq8ehHtW1QpSrPa9qBZssizr9 7EuJpnehe5PWlVbYvQSy65Lye+cjJIengiUuwEmEXR8J3dmvZ/dZJdjOsz4Ix/cpsCf6 0F92yckmI3l6FkN5Z2uPi3FxRQWVxgW+uo+dB6sKIyzLQrr+gkv/Y4XlzLjF90jbVwf5 sVNFRbIhTEHummWabJpy95JfOOzz5Fgv+iJQddOSuklTQD7qIPrGuJrKE7d1IvVi/zDx ag== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2pp1jqtg5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 30 Dec 2018 15:24:41 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wBUFOdr5030098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 30 Dec 2018 15:24:40 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBUFOdO4006779; Sun, 30 Dec 2018 15:24:39 GMT Received: from zhuyj-Latitude-E6220.lan (/221.221.43.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 30 Dec 2018 07:24:38 -0800 From: Zhu Yanjun To: santosh.shilimkar@oracle.com, davem@davemloft.net, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com Cc: Zhu Yanjun Subject: [PATCH 1/1] net: rds: remove unnecessary NULL check Date: Sun, 30 Dec 2018 23:24:11 +0800 Message-Id: <20181230152411.15096-1-yanjun.zhu@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9122 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812300142 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In kfree, the NULL check is done. Signed-off-by: Zhu Yanjun --- net/rds/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rds/tcp.c b/net/rds/tcp.c index b9bbcf3d6c63..c16f0a362c32 100644 --- a/net/rds/tcp.c +++ b/net/rds/tcp.c @@ -623,7 +623,7 @@ static void __net_exit rds_tcp_exit_net(struct net *net) if (rtn->rds_tcp_sysctl) unregister_net_sysctl_table(rtn->rds_tcp_sysctl); - if (net != &init_net && rtn->ctl_table) + if (net != &init_net) kfree(rtn->ctl_table); }