* [PATCH] remoteproc: fix the error check for idr_alloc
@ 2013-03-06 22:56 Suman Anna
2013-03-06 23:13 ` Tejun Heo
0 siblings, 1 reply; 3+ messages in thread
From: Suman Anna @ 2013-03-06 22:56 UTC (permalink / raw)
To: linux-kernel; +Cc: Suman Anna, Tejun Heo, Ohad Ben-Cohen
The new idr_alloc interface returns the allocated id back
on success, so fix the error path to check for negative
values. This was missed out in the newer idr interface
adoption patch, 15fc611 "remoteproc: convert to idr_alloc()".
Signed-off-by: Suman Anna <s-anna@ti.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/remoteproc/remoteproc_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 29387df..fb0fb34 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -217,7 +217,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
* TODO: support predefined notifyids (via resource table)
*/
ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL);
- if (ret) {
+ if (ret < 0) {
dev_err(dev, "idr_alloc failed: %d\n", ret);
dma_free_coherent(dev->parent, size, va, dma);
return ret;
--
1.8.1.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] remoteproc: fix the error check for idr_alloc
2013-03-06 22:56 [PATCH] remoteproc: fix the error check for idr_alloc Suman Anna
@ 2013-03-06 23:13 ` Tejun Heo
2013-03-17 22:36 ` Ohad Ben-Cohen
0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2013-03-06 23:13 UTC (permalink / raw)
To: Suman Anna; +Cc: linux-kernel, Ohad Ben-Cohen
On Wed, Mar 6, 2013 at 2:56 PM, Suman Anna <s-anna@ti.com> wrote:
> The new idr_alloc interface returns the allocated id back
> on success, so fix the error path to check for negative
> values. This was missed out in the newer idr interface
> adoption patch, 15fc611 "remoteproc: convert to idr_alloc()".
>
> Signed-off-by: Suman Anna <s-anna@ti.com>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Tejun Heo <tj@kernel.org>
Sorry about that.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] remoteproc: fix the error check for idr_alloc
2013-03-06 23:13 ` Tejun Heo
@ 2013-03-17 22:36 ` Ohad Ben-Cohen
0 siblings, 0 replies; 3+ messages in thread
From: Ohad Ben-Cohen @ 2013-03-17 22:36 UTC (permalink / raw)
To: Tejun Heo; +Cc: Suman Anna, linux-kernel
On Thu, Mar 7, 2013 at 1:13 AM, Tejun Heo <tj@kernel.org> wrote:
> On Wed, Mar 6, 2013 at 2:56 PM, Suman Anna <s-anna@ti.com> wrote:
>> The new idr_alloc interface returns the allocated id back
>> on success, so fix the error path to check for negative
>> values. This was missed out in the newer idr interface
>> adoption patch, 15fc611 "remoteproc: convert to idr_alloc()".
>>
>> Signed-off-by: Suman Anna <s-anna@ti.com>
>> Cc: Tejun Heo <tj@kernel.org>
>> Cc: Ohad Ben-Cohen <ohad@wizery.com>
>
> Acked-by: Tejun Heo <tj@kernel.org>
Thanks Suman, applied to fixes.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-17 22:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-06 22:56 [PATCH] remoteproc: fix the error check for idr_alloc Suman Anna
2013-03-06 23:13 ` Tejun Heo
2013-03-17 22:36 ` Ohad Ben-Cohen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®