From patchwork Sun Nov 16 13:28:23 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: 5313731 Return-Path: X-Original-To: patchwork-linux-pm@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 A9C5D9F2F1 for ; Sun, 16 Nov 2014 13:28:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E44F320155 for ; Sun, 16 Nov 2014 13:28:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CD9B2011E for ; Sun, 16 Nov 2014 13:28:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755312AbaKPN2h (ORCPT ); Sun, 16 Nov 2014 08:28:37 -0500 Received: from mout.web.de ([212.227.17.12]:54938 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755148AbaKPN2g (ORCPT ); Sun, 16 Nov 2014 08:28:36 -0500 Received: from [192.168.1.2] ([78.49.115.146]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LuLt5-1Y0c4C3dgt-011kCm; Sun, 16 Nov 2014 14:28:28 +0100 Message-ID: <5468A677.1030004@users.sourceforge.net> Date: Sun, 16 Nov 2014 14:28:23 +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: Len Brown , Pavel Machek , "Rafael J. Wysocki" , linux-pm@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Coccinelle Subject: [PATCH 1/1] kernel-power: Deletion of 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> In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:/zKrBHELmzXgOoLaptSg/0dNi2KKbu09WD6BgndaybYp4AjYcI5 uFZ+RZNkJpjeQAEkGq7WQ0GmeR1t+/hOd5GbhSWTKoQo9adzKeCfS2bVaddVuCOR9eGUH0P UBYpyAPdoWrsPRXNP8EyvRgDQ7UqNzgLFv2nkzR81XZtYRqLKgGpBFmKyEPvjw4cQ0JZFgs Urt2eZPO6XrKllKDQlIiw== X-UI-Out-Filterresults: notjunk:1; Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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=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: Sun, 16 Nov 2014 14:18:28 +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 --- kernel/power/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/power/swap.c b/kernel/power/swap.c index aaa3261..337c7a9 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -1374,7 +1374,7 @@ out_clean: kthread_stop(data[thr].thr); vfree(data); } - if (page) vfree(page); + vfree(page); return ret; }