gpu: nvgpu: fix prealloc resource alloc error handling

Only free the per-channel preallocated job-tracking resources during
channel allocation error path if they have actually been allocated.

Bug 1795076

Change-Id: I2de90504f1042ce372337b68c5405727b4e4abb4
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1234983
(cherry picked from commit 62cb75c6baa02d0edecd1f81f1b8b80a985fd715)
Reviewed-on: http://git-master/r/1238329
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Konsta Holtta
2016-10-12 10:21:02 +03:00
committed by mobile promotions
parent eca45ed722
commit d96ff67fb0

View File

@@ -1802,6 +1802,7 @@ int gk20a_alloc_channel_gpfifo(struct channel_gk20a *c,
clean_up_priv_cmd: clean_up_priv_cmd:
channel_gk20a_free_priv_cmdbuf(c); channel_gk20a_free_priv_cmdbuf(c);
clean_up_prealloc: clean_up_prealloc:
if (args->num_inflight_jobs)
channel_gk20a_free_prealloc_resources(c); channel_gk20a_free_prealloc_resources(c);
clean_up_sync: clean_up_sync:
gk20a_channel_sync_destroy(c->sync); gk20a_channel_sync_destroy(c->sync);