Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6200964 authored by Peter Huewe's avatar Peter Huewe Committed by Greg Kroah-Hartman
Browse files

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: default avatarPeter Huewe <peterhuewe@gmx.de>
Signed-off-by: default avatarRob Clark <rob@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 05014d73
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -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) {
	if ((omap_obj->flags & OMAP_BO_EXT_SYNC) && !syncobj) {
		/* clearing a previously set 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) {
		if (!syncobj) {
			ret = -ENOMEM;
			ret = -ENOMEM;
			goto unlock;
			goto unlock;
		}
		}
		memcpy(syncobj, omap_obj->sync, sizeof(*omap_obj->sync));
		omap_obj->flags &= ~OMAP_BO_EXT_SYNC;
		omap_obj->flags &= ~OMAP_BO_EXT_SYNC;
		omap_obj->sync = syncobj;
		omap_obj->sync = syncobj;
	} else if (syncobj && !(omap_obj->flags & OMAP_BO_EXT_SYNC)) {
	} else if (syncobj && !(omap_obj->flags & OMAP_BO_EXT_SYNC)) {