Message ID | 1430230199-3562-3-git-send-email-emil.l.velikov@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Apr 28, 2015 at 10:09 AM, Emil Velikov <emil.l.velikov@gmail.com> wrote: > Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> For the series: Reviewed-by: Alex Deucher <alexander.deucher@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@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
On 28 April 2015 at 18:02, Alex Deucher <alexdeucher@gmail.com> wrote: > On Tue, Apr 28, 2015 at 10:09 AM, Emil Velikov <emil.l.velikov@gmail.com> wrote: >> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> > > For the series: > Reviewed-by: Alex Deucher <alexander.deucher@amd.com> > Thank you. I'll give it another day or two before pushing (just in case). -Emil
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); } /**
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> --- xf86drm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)