Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752056AbbF1QWu (ORCPT ); Sun, 28 Jun 2015 12:22:50 -0400 Received: from mout.web.de ([212.227.15.4]:57736 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752184AbbF1QWk (ORCPT ); Sun, 28 Jun 2015 12:22:40 -0400 Message-ID: <55901F40.90500@users.sourceforge.net> Date: Sun, 28 Jun 2015 18:22:24 +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: Alex Williamson , kvm@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Alexey Kardashevskiy , Julia Lawall , Michael Ellerman Subject: [PATCH 1/2] vfio: powerpc/spapr: Delete an unnecessary check before the function call "kfree" References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <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> <55901E68.80205@users.sourceforge.net> In-Reply-To: <55901E68.80205@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:llIYl4EGn8PS1VnsljFFCLKBYzBQrVp2YsSJsM6Yp6zwAoKv6a2 CFjhbgf6h96m5j1i1Xrcv5OhB5QiSz/oAGqomJSJZqyLOq+pUk0daQK75wd6URhc+CcJ/Az IXC95ZO9oLktyfKOMiQ+cTUbvSpahxtJSsYERiucPtIdmcIq7k/gAXJqpafvrPxWD08d9Pf OXvDXIuqm2NY2c9s88vlw== X-UI-Out-Filterresults: notjunk:1;V01:K0:QkrA4afFx0w=:qiHbN28WVvHlF80ovv5C8y dCuRQriHV1PtFNEyfAuVKyAe8QvQutMgAUzkOCv/LMD+kQPaG1Fn+3/5JSxVcppgTRvTHwdHc iWl8FSloKu7NgF9HAY77jh6Kfx0A6BSfRzH7IhUAml71FYSJMI+Ftp9tzHHuPGLihpTSkMgk4 MYQP9iVN+xO4PgOonc4y7Y5bEjDZYkROXabTRgytugiB/jVMnce4Uv+OzirOiWSoR8tcamDzO 8nGxpXxJPNjVvmpf5yL1r8Zzfu/rCefDK6TpxcHD7BsyGjTOjx8RoWhFRyRS05PNwTcPDwcdj Rk7BOzxILwS0wXVDNaj6qJyd0iMYdAXwwpGZZGfIrSVsJAoLDSeOdTKq8IxmqUwDPWnl3/6CG iExBtnFMNmO793CDCeaonD+3EnYDe+M71TXsjxJJKY2ZfGJaV97AqrCjfQFrJziiRQQxqhNW3 V/sLuYkeeA5l3+D+QEiuLqr3eRzKGvKAd9HSw68fNgD9+LMmjDQL9sWbaqJUmqLKvOI5VroHQ oN+mgmlETNeew7SF9bq1r7hMFtUvXjDRrpPFbs/JIkNlHg9MHSdtzjGtaDO8XYxFT3o8rlx8+ yT30j2wjmt0OfK+rXVh1m9Ly723NQX2uvsOo4WsNNVDHdQvZx8C94Sasz3KqygYxsUxqZi2LT 3Brv96ul16aeEp1T5XDEzthO9SHTSpO8YuTre0xz15AZCtlZ694iyBvRYV4mhyu1v2ig= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1078 Lines: 34 From: Markus Elfring Date: Sun, 28 Jun 2015 17:43:48 +0200 The kfree() 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 --- drivers/vfio/vfio_iommu_spapr_tce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c index 0582b72..50ddfac 100644 --- a/drivers/vfio/vfio_iommu_spapr_tce.c +++ b/drivers/vfio/vfio_iommu_spapr_tce.c @@ -1215,7 +1215,7 @@ static int tce_iommu_attach_group(void *iommu_data, } unlock_exit: - if (ret && tcegrp) + if (ret) kfree(tcegrp); mutex_unlock(&container->lock); -- 2.4.4 -- 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/