[PATCH libdrm 3/3] xf86drm: simplify drmMalloc/drmFree

Alex Deucher alexdeucher at gmail.com
Tue Apr 28 10:02:47 PDT 2015


On Tue, Apr 28, 2015 at 10:09 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  xf86drm.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index f7c45f8..9cd0b02 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -140,16 +140,12 @@ void *drmGetHashTable(void)
>
>  void *drmMalloc(int size)
>  {
> -    void *pt;
> -    if ((pt = malloc(size)))
> -       memset(pt, 0, size);
> -    return pt;
> +    return calloc(1, size);
>  }
>
>  void drmFree(void *pt)
>  {
> -    if (pt)
> -       free(pt);
> +    free(pt);
>  }
>
>  /**
> --
> 2.3.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list