Skip to content

Commit

Permalink
staging/omapdrm: Use kmemdup rather than duplicating its implementation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Huewe authored and Rob Clark committed Feb 16, 2013
1 parent 32ac1a5 commit a4462f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/omapdrm/omap_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit a4462f2

Please sign in to comment.