File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1121,12 +1121,16 @@ static void msm_gem_free_object(struct drm_gem_object *obj)
11211121 put_pages (obj );
11221122 }
11231123
1124- if (obj -> resv != & obj -> _resv ) {
1124+ /*
1125+ * In error paths, we could end up here before msm_gem_new_handle()
1126+ * has changed obj->resv to point to the shared resv. In this case,
1127+ * we don't want to drop a ref to the shared r_obj that we haven't
1128+ * taken yet.
1129+ */
1130+ if ((msm_obj -> flags & MSM_BO_NO_SHARE ) && (obj -> resv != & obj -> _resv )) {
11251131 struct drm_gem_object * r_obj =
11261132 container_of (obj -> resv , struct drm_gem_object , _resv );
11271133
1128- WARN_ON (!(msm_obj -> flags & MSM_BO_NO_SHARE ));
1129-
11301134 /* Drop reference we hold to shared resv obj: */
11311135 drm_gem_object_put (r_obj );
11321136 }
You can’t perform that action at this time.
0 commit comments