From patchwork Mon Dec 1 18:55:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 5414821 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7DEFE9F319 for ; Mon, 1 Dec 2014 18:56:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B62FD2026C for ; Mon, 1 Dec 2014 18:56:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B24592026F for ; Mon, 1 Dec 2014 18:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753315AbaLAS4T (ORCPT ); Mon, 1 Dec 2014 13:56:19 -0500 Received: from mout.web.de ([212.227.15.14]:49667 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752854AbaLAS4S (ORCPT ); Mon, 1 Dec 2014 13:56:18 -0500 Received: from [192.168.1.2] ([78.48.162.200]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0M8L3a-1Y9BLN0KIc-00vysh; Mon, 01 Dec 2014 19:56:03 +0100 Message-ID: <547CB9BD.5050101@users.sourceforge.net> Date: Mon, 01 Dec 2014 19:55:57 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Greg Kroah-Hartman , Jarod Wilson , Mauro Carvalho Chehab , linux-media@vger.kernel.org, devel@driverdev.osuosl.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH 1/1] [media] lirc_zilog: Deletion of unnecessary checks 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> In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:mwZElN0T5sQgeoK6CSToFdJsOFeFWDPhL2I+HD+v4N2RC+gNQsB p4c+VDDoUr1OHO3WyNuT4w+eifRN+OaMrFyOkNs7AaQJl/qf8y1yFsb4cAWi4uNUOpV2S+U nVfpj5tlK6ghYC7VpIaUtdW5tRGZeXp/xzjfmZbjz0EiboVvTRO6/w4dNN2jlGkdSCGq3Ll FIO2sP2bLXrK6ff91xnTA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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: Mon, 1 Dec 2014 19:49:39 +0100 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/staging/media/lirc/lirc_zilog.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c index 3259aac..50b255a 100644 --- a/drivers/staging/media/lirc/lirc_zilog.c +++ b/drivers/staging/media/lirc/lirc_zilog.c @@ -729,11 +729,9 @@ static int send_boot_data(struct IR_tx *tx) static void fw_unload_locked(void) { if (tx_data) { - if (tx_data->code_sets) - vfree(tx_data->code_sets); + vfree(tx_data->code_sets); - if (tx_data->datap) - vfree(tx_data->datap); + vfree(tx_data->datap); vfree(tx_data); tx_data = NULL;