diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c b/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c index 0fa31468..2038e300 100644 --- a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c | |||
@@ -122,7 +122,7 @@ struct gk20a_semaphore_pool *gk20a_semaphore_pool_alloc( | |||
122 | { | 122 | { |
123 | struct gk20a_semaphore_pool *p; | 123 | struct gk20a_semaphore_pool *p; |
124 | unsigned long page_idx; | 124 | unsigned long page_idx; |
125 | int err = 0; | 125 | int ret, err = 0; |
126 | 126 | ||
127 | p = kzalloc(sizeof(*p), GFP_KERNEL); | 127 | p = kzalloc(sizeof(*p), GFP_KERNEL); |
128 | if (!p) | 128 | if (!p) |
@@ -130,13 +130,14 @@ struct gk20a_semaphore_pool *gk20a_semaphore_pool_alloc( | |||
130 | 130 | ||
131 | __lock_sema_sea(sea); | 131 | __lock_sema_sea(sea); |
132 | 132 | ||
133 | page_idx = __semaphore_bitmap_alloc(sea->pools_alloced, | 133 | ret = __semaphore_bitmap_alloc(sea->pools_alloced, SEMAPHORE_POOL_COUNT); |
134 | SEMAPHORE_POOL_COUNT); | 134 | if (ret < 0) { |
135 | if (page_idx < 0) { | 135 | err = ret; |
136 | err = page_idx; | ||
137 | goto fail; | 136 | goto fail; |
138 | } | 137 | } |
139 | 138 | ||
139 | page_idx = (unsigned long)ret; | ||
140 | |||
140 | p->page = sea->sea_mem.pages[page_idx]; | 141 | p->page = sea->sea_mem.pages[page_idx]; |
141 | p->ro_sg_table = sea->ro_sg_table; | 142 | p->ro_sg_table = sea->ro_sg_table; |
142 | p->page_idx = page_idx; | 143 | p->page_idx = page_idx; |