Thread (1341 messages) 1341 messages, 165 authors, 2017-04-12

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

From: Sean Paul <hidden>
Date: 2016-07-22 15:25:55
Also in: dri-devel, kernel-janitors

On Fri, Jul 22, 2016 at 7:45 AM, SF Markus Elfring
[off-list ref] wrote:
From: Markus Elfring <redacted>
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 <redacted>
Applied to drm-misc
quoted hunk ↗ jump to hunk
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help