summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_agpsupport.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-12-18 11:27:06 +1000
committerDave Airlie <airlied@redhat.com>2013-12-18 11:27:06 +1000
commitd5e41ad3b947be2615e7d9102333e918d012c340 (patch)
tree5220a16ff2fe153c6e32a727f9387b31928388d2 /drivers/gpu/drm/drm_agpsupport.c
parent4efafebe709b8daa90b2f34a6e242eec7df98f25 (diff)
downloadtalos-op-linux-d5e41ad3b947be2615e7d9102333e918d012c340.tar.gz
talos-op-linux-d5e41ad3b947be2615e7d9102333e918d012c340.zip
drm/agpsupport: use kzalloc instead of kmalloc/memset
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_agpsupport.c')
-rw-r--r--drivers/gpu/drm/drm_agpsupport.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index 1f544af43617..74fabe6956cb 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -204,11 +204,9 @@ int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request)
if (!dev->agp || !dev->agp->acquired)
return -EINVAL;
- if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL)))
+ if (!(entry = kzalloc(sizeof(*entry), GFP_KERNEL)))
return -ENOMEM;
- memset(entry, 0, sizeof(*entry));
-
pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
type = (u32) request->type;
if (!(memory = agp_allocate_memory(dev->agp->bridge, pages, type))) {
@@ -401,9 +399,8 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
{
struct drm_agp_head *head = NULL;
- if (!(head = kmalloc(sizeof(*head), GFP_KERNEL)))
+ if (!(head = kzalloc(sizeof(*head), GFP_KERNEL)))
return NULL;
- memset((void *)head, 0, sizeof(*head));
head->bridge = agp_find_bridge(dev->pdev);
if (!head->bridge) {
if (!(head->bridge = agp_backend_acquire(dev->pdev))) {
OpenPOWER on IntegriCloud