Skip to content

Commit

Permalink
drm: simplify master cleanup
Browse files Browse the repository at this point in the history
In drm_master_destroy() we _free_ the master object. There is no reason to
hold any locks while dropping its static members, nor do we have to reset
it to 0.

Furthermore, kfree() already does NULL checks, so call it directly on
master->unique and drop the redundant reset-code.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
David Herrmann authored and Daniel Vetter committed May 5, 2015
1 parent 32e7b94 commit 4a324d3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/gpu/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,10 @@ static void drm_master_destroy(struct kref *kref)
r_list = NULL;
}
}

if (master->unique) {
kfree(master->unique);
master->unique = NULL;
master->unique_len = 0;
}
mutex_unlock(&dev->struct_mutex);

idr_destroy(&master->magic_map);
kfree(master->unique);
kfree(master);
}

Expand Down

0 comments on commit 4a324d3

Please sign in to comment.