From patchwork Mon Jul 6 08:01:13 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: 6735651 Return-Path: X-Original-To: patchwork-dri-devel@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 263729F3E6 for ; Tue, 7 Jul 2015 17:07:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D7C02069A for ; Tue, 7 Jul 2015 17:07:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7BDFF20751 for ; Tue, 7 Jul 2015 17:07:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E25966E5DE; Tue, 7 Jul 2015 10:07:25 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.17.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id D70366E005 for ; Mon, 6 Jul 2015 01:01:18 -0700 (PDT) Received: from [192.168.1.2] ([77.181.40.148]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0MJkxE-1ZD7Gh1108-0017g2; Mon, 06 Jul 2015 10:01:15 +0200 Message-ID: <559A35C9.8050201@users.sourceforge.net> Date: Mon, 06 Jul 2015 10:01:13 +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: David Airlie , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 1/1] DRM-vmwgfx: 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> <546CCB7E.3050109@users.sourceforge.net> In-Reply-To: <546CCB7E.3050109@users.sourceforge.net> X-Provags-ID: V03:K0:BimM+CBdXNELFzrqW3BFGGSWE4dLomLvBHyj7RncSSqq2ilso+3 u0VxpTI/gOEpFdkDaZEMx4Kej8F0ytl1Ap14NAHNC2B9ID0qwFCUO7F2gVRI6PIa8pENH4s S1uDPOiLlNj2fB/sKX8c6hchuZ7ZDzks1t9dRU4LuDCEZE6VJY6evxHDImHezTvFK0sWTqK /wyKx19/WhsAWBmBRxlDg== X-UI-Out-Filterresults: notjunk:1; V01:K0:4Oj8YfSUwio=:FR+wLbFI4MrPeDRp3SSY+F ROpVuvVduYfHzbisRjBDi45ab6oJR4vDJw+ZxuMaxmhIpHCKfI4VYgD7JcnOYsH8rQFAvKLdj 8WoMFCRe8EInzHaENmspZVy510nKFbLkSL5PZwP+KhXmysDqzMzQdjHKMG1qv/mhqxikmBlhl FfEa5JvuRXn0JRo/Ko4lVxCCgCX+ZgRP/lVNZdUvN0/HQPA3L4gKbXTGtBNjxNHfXUZPuqZ/o 9vYeZ/WCH7kN5yGiz1DOiqyrQtgzN/kmExr+60VyNE+Mh16S6VjMHk1vQThQAQ4nCIEhLkSfe gX3YsmemJIB1wJGgSSRcf8qgPUJkTUaFY1YD5k2X6LdBdyGGyy8vYCaJ67si2p1URpxn32L3R aiJ9OyeKf5QFvQ1bPhDYV+0BY7GIWjysjYb6nVkHnqh24jOhERqDkV//qbHHYf3ypyu8muQMG k/mYL8vAHnEuseJv+8I/2mrzxAQuHxW8xB4dSiCU7NxX8rjv8hLKqvE9JfN3ZAFq3rcmbT2Jd g8Ax3H4EFLGVI9TAadKWTy6iw8utlOMTToaekqh7ty53yC51jLXkv8hxe163Y/Wldpm6SMZPQ 7iv869M8Ls+XX4wHTiJA+WErCjgIDDhf5vjXCmF+y39BWaPTxKFnZjHaZmXTC+jP287cpaBmS zEyMM/hYtyiogEsoqtIWWupQpSEOvXTR4QcU2Zv2/CNfpzUpf+OdVqxPUrlQA+FkMqMk= X-Mailman-Approved-At: Tue, 07 Jul 2015 10:07:24 -0700 Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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, 6 Jul 2015 09:49:11 +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 Reviewed-by: Zhao Junwang --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 654c8da..f718a6d 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -2292,9 +2292,7 @@ static int vmw_resize_cmd_bounce(struct vmw_sw_context *sw_context, (sw_context->cmd_bounce_size >> 1)); } - if (sw_context->cmd_bounce != NULL) - vfree(sw_context->cmd_bounce); - + vfree(sw_context->cmd_bounce); sw_context->cmd_bounce = vmalloc(sw_context->cmd_bounce_size); if (sw_context->cmd_bounce == NULL) {