[PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree"

John Hunter zhjwpku at gmail.com
Tue Jul 7 22:49:00 PDT 2015


On Mon, Jul 6, 2015 at 4:01 PM, SF Markus Elfring <
elfring at users.sourceforge.net> wrote:

> From: Markus Elfring <elfring at users.sourceforge.net>
> 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 <elfring at users.sourceforge.net>
>

Reviewed-by: Zhao Junwang <zhjwpku at gmail.com>

kfree will check that.

> ---
>  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) {
> --
> 2.4.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>



-- 
Best regards
Junwang Zhao
Microprocessor Research and Develop Center
Department of Computer Science &Technology
Peking University
Beijing, 100871, PRC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150708/310af3ed/attachment.html>


More information about the dri-devel mailing list