From patchwork Wed Jun 24 18:45:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 6669811 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9666B9F380 for ; Wed, 24 Jun 2015 18:45:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C18DD20595 for ; Wed, 24 Jun 2015 18:45:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B7C132058A for ; Wed, 24 Jun 2015 18:45:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752608AbbFXSpT (ORCPT ); Wed, 24 Jun 2015 14:45:19 -0400 Received: from mout.web.de ([212.227.17.12]:51808 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752418AbbFXSpR (ORCPT ); Wed, 24 Jun 2015 14:45:17 -0400 Received: from [192.168.1.3] ([78.49.141.189]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LqDYi-1YcsZ320Ey-00drLi; Wed, 24 Jun 2015 20:45:09 +0200 Message-ID: <558AFAB3.2020108@users.sourceforge.net> Date: Wed, 24 Jun 2015 20:45:07 +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: Brian Uchino , Hiral Patel , "James E. J. Bottomley" , Suma Ramars , linux-scsi@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH] SCSI-fnic: Delete an unnecessary check before the function call "vfree" 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> <546EFBBB.7000409@users.sourceforge.net> In-Reply-To: <546EFBBB.7000409@users.sourceforge.net> X-Provags-ID: V03:K0:HFg4RS5g2ZzDa56BphXhNeyu2Zvc/QQXwAx4KF9d9jClGaJK/Zm R+AChBJtkQgsgy7jr0gBW7Cb4ULnJ72S72TbaGpzYS5c9+dt5QlMsaSEZ+gpgsNUuRCH1P4 t83E6NsmG/BArKPN9815ry8s7zSkbk5CZM0IakGnUwQDks0fCLMZGi3w/LCkhxXdophjuHd L8tQ1ktHsvMpTMocxpgvQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:X+IhS8/m7WU=:EikvJD6q/tCFJPamz79Nm+ gsIJOcCd8aVEGGPdyi5txS48YlBjLWV4jM1AC0goxOfySMaRWiShWFpPxI/ivKg3P3Dkzh4E5 WMpME7Y+boygjrahwTTHIbguLBVGnCUYvVqL5c+7UuaOTpwGNH1KilzWe+GMw2q65EWzs4krM kL3dgYSRg7cV0U9uB5quGD6sSqv/1PjlhD0PaWUyDUH9TABccRiVriqVGf3wltsY7EIOp1C37 0jzHDGzSObaV2K0ervOsTn3DuNH/TRJ+9uHGfSVwam1JtAABAU0oWuCta05wYl+zAmAEsYSnP ZUTVKTwb/NztAUYY7uuTJHjDdgZcjuKuppEa6q5hFTbCVNkgiN99XNhvkW2CGgoW6QEuLA+CP 1n0E+ZbBlR0nL+zzsROj1ByJOKAHrnsG3pQ+fUDTAaEwy2gXrtsW5sj+npBOy1VZ5VWYWOrkC A8Wgy5i79D4KGYcHBo670GgOIiV5cHQaB6+h7X88xJVpvfasawZty9zt84PSf4j2QuYUe62f7 btbWGkluK6GDY6YHqfFMn0jWOfzDkVO05H/G8YHJup3s7wmG2kX5UfCSlc+tdICK/Ckj25jOi eSpjzVim/03KX4CCdCp2nzQeWaJzOc0nhO3Bn/QvsQoRDxYHQ7miWGAnkNJTDyIjQhAdYveXH Yh5Ffqq9XUzoDAA+GXW2hs79XMG+cndX/MFgabL3fBQfGWm5joaCmBaMBcnk+pKtnzrg= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 24 Jun 2015 20:40:35 +0200 The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/scsi/fnic/fnic_debugfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c index d6498fa..855d382 100644 --- a/drivers/scsi/fnic/fnic_debugfs.c +++ b/drivers/scsi/fnic/fnic_debugfs.c @@ -102,9 +102,7 @@ void fnic_debugfs_terminate(void) debugfs_remove(fnic_trace_debugfs_root); fnic_trace_debugfs_root = NULL; - - if (fc_trc_flag) - vfree(fc_trc_flag); + vfree(fc_trc_flag); } /*