lkml.org 
[lkml]   [2013]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] uio: fix error return code in uio_dev_add_attributes()
From
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return -ENOMEM in the kobject_create_and_add() and kzalloc() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/uio/uio.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index b645c47..c6dfc31 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -276,6 +276,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
mem = &idev->info->mem[mi];
if (mem->size == 0)
break;
+ ret = -ENOMEM;
if (!map_found) {
map_found = 1;
idev->map_dir = kobject_create_and_add("maps",
@@ -301,6 +302,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
port = &idev->info->port[pi];
if (port->size == 0)
break;
+ ret = -ENOMEM;
if (!portio_found) {
portio_found = 1;
idev->portio_dir = kobject_create_and_add("portio",


\
 
 \ /
  Last update: 2013-05-09 04:41    [W:0.023 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site