summaryrefslogtreecommitdiff
path: root/drivers/staging/omapdrm
diff options
context:
space:
mode:
authorPeter Huewe <peterhuewe@gmx.de>2013-01-25 23:40:13 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-30 04:22:16 (GMT)
commite6200964713e381cb19017ccf567a0fb886b9c6c (patch)
treeaed3d446fdc3c13705ef3a9ba44916e8cc5b705e /drivers/staging/omapdrm
parent05014d73d68a0f5203fc78eb58e6d7e512581695 (diff)
downloadlinux-fsl-qoriq-e6200964713e381cb19017ccf567a0fb886b9c6c.tar.xz
staging/omapdrm: Use kmemdup rather than duplicating its implementation
Found with coccicheck. The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/omapdrm')
-rw-r--r--drivers/staging/omapdrm/omap_gem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c
index 08f1e292..f9297eb 100644
--- a/drivers/staging/omapdrm/omap_gem.c
+++ b/drivers/staging/omapdrm/omap_gem.c
@@ -1267,12 +1267,12 @@ int omap_gem_set_sync_object(struct drm_gem_object *obj, void *syncobj)
if ((omap_obj->flags & OMAP_BO_EXT_SYNC) && !syncobj) {
/* clearing a previously set syncobj */
- syncobj = kzalloc(sizeof(*omap_obj->sync), GFP_ATOMIC);
+ syncobj = kmemdup(omap_obj->sync, sizeof(*omap_obj->sync),
+ GFP_ATOMIC);
if (!syncobj) {
ret = -ENOMEM;
goto unlock;
}
- memcpy(syncobj, omap_obj->sync, sizeof(*omap_obj->sync));
omap_obj->flags &= ~OMAP_BO_EXT_SYNC;
omap_obj->sync = syncobj;
} else if (syncobj && !(omap_obj->flags & OMAP_BO_EXT_SYNC)) {