History

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.

Peter Huewe committed 13 years ago

Commit a4462f21 parent 32ac1a51 file · +2 −2Browse files

Unified · Split

drivers/staging/omapdrm/omap_gem.c+2−2
@@ -1267,12 +1267,12 @@ int omap_gem_set_sync_object(struct drm_gem_object *obj, void *syncobj) · 1266 unmodified lines
1267 1267
1268 if ((omap_obj->flags & OMAP_BO_EXT_SYNC) && !syncobj) {1268 if ((omap_obj->flags & OMAP_BO_EXT_SYNC) && !syncobj) {
1269 /* clearing a previously set syncobj */1269 /* clearing a previously set syncobj */
1270 syncobj = kzalloc(sizeof(*omap_obj->sync), GFP_ATOMIC);1270 syncobj = kmemdup(omap_obj->sync, sizeof(*omap_obj->sync),
1271 GFP_ATOMIC);
1271 if (!syncobj) {1272 if (!syncobj) {
1272 ret = -ENOMEM;1273 ret = -ENOMEM;
1273 goto unlock;1274 goto unlock;
1274 }1275 }
1275 memcpy(syncobj, omap_obj->sync, sizeof(*omap_obj->sync));
1276 omap_obj->flags &= ~OMAP_BO_EXT_SYNC;1276 omap_obj->flags &= ~OMAP_BO_EXT_SYNC;
1277 omap_obj->sync = syncobj;1277 omap_obj->sync = syncobj;
1278 } else if (syncobj && !(omap_obj->flags & OMAP_BO_EXT_SYNC)) {1278 } else if (syncobj && !(omap_obj->flags & OMAP_BO_EXT_SYNC)) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t