File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1589,7 +1589,8 @@ dxgkio_create_allocation(struct dxgprocess *process, void *__user inargs)
15891589 & process -> handle_table ,
15901590 HMGRENTRY_TYPE_DXGRESOURCE ,
15911591 args .resource );
1592- kref_get (& resource -> resource_kref );
1592+ if (resource != NULL )
1593+ kref_get (& resource -> resource_kref );
15931594 dxgprocess_ht_lock_shared_up (process );
15941595
15951596 if (resource == NULL || resource -> device != device ) {
@@ -1693,10 +1694,8 @@ dxgkio_create_allocation(struct dxgprocess *process, void *__user inargs)
16931694 & standard_alloc );
16941695cleanup :
16951696
1696- if (resource_mutex_acquired ) {
1697+ if (resource_mutex_acquired )
16971698 mutex_unlock (& resource -> resource_mutex );
1698- kref_put (& resource -> resource_kref , dxgresource_release );
1699- }
17001699 if (ret < 0 ) {
17011700 if (dxgalloc ) {
17021701 for (i = 0 ; i < args .alloc_count ; i ++ ) {
@@ -1727,6 +1726,9 @@ dxgkio_create_allocation(struct dxgprocess *process, void *__user inargs)
17271726 if (adapter )
17281727 dxgadapter_release_lock_shared (adapter );
17291728
1729+ if (resource && !args .flags .create_resource )
1730+ kref_put (& resource -> resource_kref , dxgresource_release );
1731+
17301732 if (device ) {
17311733 dxgdevice_release_lock_shared (device );
17321734 kref_put (& device -> device_kref , dxgdevice_release );
You can’t perform that action at this time.
0 commit comments