Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751864AbbGBPNN (ORCPT ); Thu, 2 Jul 2015 11:13:13 -0400 Received: from mout.web.de ([212.227.17.11]:63990 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025AbbGBPNI (ORCPT ); Thu, 2 Jul 2015 11:13:08 -0400 Message-ID: <55955471.9000501@users.sourceforge.net> Date: Thu, 02 Jul 2015 17:10:41 +0200 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "David S. Miller" , Jozsef Kadlecsik , Julian Anastasov , Pablo Neira Ayuso , Patrick McHardy , Simon Horman , Wensong Zhang , netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org CC: LKML , "kernel-janitors@vger.kernel.org" , Julia Lawall Subject: [PATCH] net-ipvs: Delete an unnecessary check before the function call "module_put" References: <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <546BA253.6030100@users.sourceforge.net> <20141119134040.GA12270@salvia> In-Reply-To: <20141119134040.GA12270@salvia> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:PlRvJbd2kgHucl2AMC8OBDTvP15SZMO1DQF3Cs3wA3K2+7osGiP Vg8Y3lUYQdXxM+2mVvtYo4WS30a4fHbj264ZKGLueW2SOwckMQM4RnVZl65kl2HCGq9KlQL BChJbM5xHgx86H0HRIzvdiAhBRrvtvYMeqpucwcfR5ts7hyZK8ul0PkWG9qmga1tI+xxNyO yeQsjoCCBmzXazKuFV+aQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ijP9nMFrk88=:LOLE0Zm1TncKJdviJ72448 1s5dqucsH0d+hfEKM5Mwl3lHUI7ZcUmrvDrcQAmbL9VKSGXdKMPoiT5XaUu0gvQem9J/TZAqa 0F8VDPcpGzeFRA/LNK2gb/yCtXuRH1CtY//oIG/dZSdOkPLWwEpHtFosz+KaV2QIzMKpOVhqe JmmM1J+mSjUr1ykxfUWrNmQkNkv9xJ8OFMhFWwHAuy7yupYxQcQZX0uXdJ5CPvA0yfEu7+Vox VQf8PUXmYLSD8tN1nXIMrVqHM90UZIwpk8YoMxIqriKnW0Hxp5Opub2mR8j91uBeFLXyKRGx1 8nJNpwckE37l07xe0Axyp/FbrdBj94hyO0UFAZiRHPb3NLWvGL0gfiTNVu+gyNBrupP5DLy0W eNvdpDxjfzV0YamQSJwGaAHi8YnoN9EdmT2G5smPDMTzlAPT37zi/KeoHbZ4q2vU9Q5DXY+Nk +8kqMl/IbOhl6u/IFpt4jw5U5ZGNhwm5SOEn9V91uMiXz57BKNkdJqR5hOXF6RufQuWjzFf+Q mRB/ZYIM7dZ6x1sqVHYGtS0MBk6L2EQBCjI8IPq9uFyGN+PsdHVSMYzeocWXvgniYKBJ5yqlE BqZbpJI7pvgEQd9kKFnC8EulIJIWEkmblGXCTfcUHGJ3yhqF76VWM4sV1xAEtBYWZkTNN7J+b D3K1pYNQw2+GyemMbS+tn540nkuMUZAFvpq1AYFJTKalJAT5sOD6LiIjyE5SDEvpXNUg= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1135 Lines: 34 From: Markus Elfring Date: Thu, 2 Jul 2015 17:00:14 +0200 The module_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- net/netfilter/ipvs/ip_vs_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/ipvs/ip_vs_sched.c b/net/netfilter/ipvs/ip_vs_sched.c index 199760c..e50221b 100644 --- a/net/netfilter/ipvs/ip_vs_sched.c +++ b/net/netfilter/ipvs/ip_vs_sched.c @@ -137,7 +137,7 @@ struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name) void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler) { - if (scheduler && scheduler->module) + if (scheduler) module_put(scheduler->module); } -- 2.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/