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
12671267
12681268 if ((omap_obj->flags & OMAP_BO_EXT_SYNC) && !syncobj) {
12691269 /* 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);
12711272 if (!syncobj) {
12721273 ret = -ENOMEM;
12731274 goto unlock;
12741275 }
1275− memcpy(syncobj, omap_obj->sync, sizeof(*omap_obj->sync));
12761276 omap_obj->flags &= ~OMAP_BO_EXT_SYNC;
12771277 omap_obj->sync = syncobj;
12781278 } 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