Skip to content

Commit

Permalink
drm/lease: fix WARNING in idr_destroy
Browse files Browse the repository at this point in the history
We need to get idr_mutex first for idr_alloc.

Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
  • Loading branch information
hqj committed Mar 14, 2020
1 parent fffb08b commit 48d976f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/drm_lease.c
Expand Up @@ -420,6 +420,7 @@ static int fill_object_idr(struct drm_device *dev,

/* add their IDs to the lease request - taking into account
universal planes */
mutex_lock(&dev->mode_config.idr_mutex);
for (o = 0; o < object_count; o++) {
struct drm_mode_object *obj = objects[o];
u32 object_id = objects[o]->id;
Expand Down Expand Up @@ -457,6 +458,7 @@ static int fill_object_idr(struct drm_device *dev,
}
}
}
mutex_unlock(&dev->mode_config.idr_mutex);

ret = 0;
out_free_objects:
Expand Down

0 comments on commit 48d976f

Please sign in to comment.