Subversion Repositories Kolibri OS

Rev

Rev 3260 | Rev 3298 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3260 Rev 3290
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
 
220
	spin_lock(&filp->table_lock);
221
	spin_lock(&filp->table_lock);
Line 221... Line 222...
221
 
222
 
222
	/* Check if we currently have a reference on the object */
223
	/* Check if we currently have a reference on the object */
223
	obj = idr_find(&filp->object_idr, handle);
224
	obj = idr_find(&filp->object_idr, handle);
224
	if (obj == NULL) {
225
	if (obj == NULL) {
225
		spin_unlock(&filp->table_lock);
226
		spin_unlock(&filp->table_lock);
226
		return -EINVAL;
227
		return -EINVAL;
227
	}
228
	}
Line -... Line 229...
-
 
229
	dev = obj->dev;
-
 
230
 
228
	dev = obj->dev;
231
    printf("%s handle %d obj %p\n", __FUNCTION__, handle, obj);
229
 
232
 
230
	/* Release reference and decrement refcount. */
233
	/* Release reference and decrement refcount. */
Line 231... Line 234...
231
	idr_remove(&filp->object_idr, handle);
234
	idr_remove(&filp->object_idr, handle);