Rev 3290 | Rev 3480 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3290 | Rev 3298 | ||
---|---|---|---|
Line 215... | Line 215... | ||
215 | * could race us to double-decrement the refcount and cause a |
215 | * could race us to double-decrement the refcount and cause a |
216 | * use-after-free later. Given the frequency of our handle lookups, |
216 | * use-after-free later. Given the frequency of our handle lookups, |
217 | * we may want to use ida for number allocation and a hash table |
217 | * we may want to use ida for number allocation and a hash table |
218 | * for the pointers, anyway. |
218 | * for the pointers, anyway. |
219 | */ |
219 | */ |
220 | - | ||
221 | spin_lock(&filp->table_lock); |
220 | spin_lock(&filp->table_lock); |
Line 222... | Line 221... | ||
222 | 221 | ||
223 | /* Check if we currently have a reference on the object */ |
222 | /* Check if we currently have a reference on the object */ |
224 | obj = idr_find(&filp->object_idr, handle); |
223 | obj = idr_find(&filp->object_idr, handle); |
225 | if (obj == NULL) { |
224 | if (obj == NULL) { |
226 | spin_unlock(&filp->table_lock); |
225 | spin_unlock(&filp->table_lock); |
227 | return -EINVAL; |
226 | return -EINVAL; |
228 | } |
227 | } |
Line 229... | Line 228... | ||
229 | dev = obj->dev; |
228 | dev = obj->dev; |
Line 230... | Line 229... | ||
230 | 229 | ||
231 | printf("%s handle %d obj %p\n", __FUNCTION__, handle, obj); |
230 | // printf("%s handle %d obj %p\n", __FUNCTION__, handle, obj); |
232 | 231 |