Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1448542 > unrolled thread

[PATCH] drm/vmwgfx: Delete an unnecessary check before the function call "vfree"

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2016-07-22 13:50 +0200
Last post2016-07-22 17:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] drm/vmwgfx: Delete an unnecessary check before the function  call "vfree" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-22 13:50 +0200
    Re: [PATCH] drm/vmwgfx: Delete an unnecessary check before the  function call "vfree" Sean Paul <seanpaul@chromium.org> - 2016-07-22 17:30 +0200

#1448542 — [PATCH] drm/vmwgfx: Delete an unnecessary check before the function call "vfree"

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-07-22 13:50 +0200
Subject[PATCH] drm/vmwgfx: Delete an unnecessary check before the function call "vfree"
Message-ID<rXH7P-5hk-9@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 22 Jul 2016 13:31:00 +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 <elfring@users.sourceforge.net>
---
 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 1a1a87c..dc5beff 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
@@ -3625,9 +3625,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) {
-- 
2.9.2

[toc] | [next] | [standalone]


#1448637 — Re: [PATCH] drm/vmwgfx: Delete an unnecessary check before the function call "vfree"

FromSean Paul <seanpaul@chromium.org>
Date2016-07-22 17:30 +0200
SubjectRe: [PATCH] drm/vmwgfx: Delete an unnecessary check before the function call "vfree"
Message-ID<rXKyK-7ye-17@gated-at.bofh.it>
In reply to#1448542
On Fri, Jul 22, 2016 at 7:45 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 22 Jul 2016 13:31:00 +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 <elfring@users.sourceforge.net>

Applied to drm-misc

> ---
>  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 1a1a87c..dc5beff 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> @@ -3625,9 +3625,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) {
> --
> 2.9.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web