From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Mon, 01 Dec 2014 18:55:57 +0000 Subject: [PATCH 1/1] [media] lirc_zilog: Deletion of unnecessary checks before the function call "vfree" Message-Id: <547CB9BD.5050101@users.sourceforge.net> List-Id: 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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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; -- 2.1.3