X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=lib%2Fidr.c;h=f4ab4f4aa3c7f5b269dcd1917c65f15f03d2475a;hb=86406a9e733347f877a2bd5269ce7429d3748c6a;hp=c2cf2c52bbde5c54534b2227cee2176baf78383a;hpb=b1da3acc781ce445445d959b41064d209a27bc2d;p=linux-2.6-microblaze.git diff --git a/lib/idr.c b/lib/idr.c index c2cf2c52bbde..f4ab4f4aa3c7 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -372,7 +372,8 @@ EXPORT_SYMBOL(idr_replace); * Allocate an ID between @min and @max, inclusive. The allocated ID will * not exceed %INT_MAX, even if @max is larger. * - * Context: Any context. + * Context: Any context. It is safe to call this function without + * locking in your code. * Return: The allocated ID, or %-ENOMEM if memory could not be allocated, * or %-ENOSPC if there are no free IDs. */ @@ -470,6 +471,7 @@ alloc: goto retry; nospc: xas_unlock_irqrestore(&xas, flags); + kfree(alloc); return -ENOSPC; } EXPORT_SYMBOL(ida_alloc_range); @@ -479,7 +481,8 @@ EXPORT_SYMBOL(ida_alloc_range); * @ida: IDA handle. * @id: Previously allocated ID. * - * Context: Any context. + * Context: Any context. It is safe to call this function without + * locking in your code. */ void ida_free(struct ida *ida, unsigned int id) { @@ -531,7 +534,8 @@ EXPORT_SYMBOL(ida_free); * or freed. If the IDA is already empty, there is no need to call this * function. * - * Context: Any context. + * Context: Any context. It is safe to call this function without + * locking in your code. */ void ida_destroy(struct ida *ida) {