linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized
@ 2012-11-27 11:48 Vitalii Demianets
  2012-11-27 12:24 ` Vitalii Demianets
  2012-11-27 22:43 ` Hans J. Koch
  0 siblings, 2 replies; 24+ messages in thread
From: Vitalii Demianets @ 2012-11-27 11:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: Hans J. Koch, Greg Kroah-Hartman

Fix warning: 'ret' might be used uninitialized

Signed-off-by: Vitalii Demianets <vitas@nppfactor.kiev.ua>
---
 drivers/uio/uio.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 5110f36..c33fd18 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -280,12 +280,16 @@ static int uio_dev_add_attributes(struct uio_device *idev)
 			map_found = 1;
 			idev->map_dir = kobject_create_and_add("maps",
 							&idev->dev->kobj);
-			if (!idev->map_dir)
+			if (!idev->map_dir) {
+				ret = -ENOMEM;
 				goto err_map;
+			}
 		}
 		map = kzalloc(sizeof(*map), GFP_KERNEL);
-		if (!map)
+		if (!map) {
+			ret = -ENOMEM;
 			goto err_map;
+		}
 		kobject_init(&map->kobj, &map_attr_type);
 		map->mem = mem;
 		mem->map = map;
@@ -305,12 +309,16 @@ static int uio_dev_add_attributes(struct uio_device *idev)
 			portio_found = 1;
 			idev->portio_dir = kobject_create_and_add("portio",
 							&idev->dev->kobj);
-			if (!idev->portio_dir)
+			if (!idev->portio_dir) {
+				ret = -ENOMEM;
 				goto err_portio;
+			}
 		}
 		portio = kzalloc(sizeof(*portio), GFP_KERNEL);
-		if (!portio)
+		if (!portio) {
+			ret = -ENOMEM;
 			goto err_portio;
+		}
 		kobject_init(&portio->kobj, &portio_attr_type);
 		portio->port = port;
 		port->portio = portio;
-- 
1.7.8.6

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-12-03 17:28 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-27 11:48 [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized Vitalii Demianets
2012-11-27 12:24 ` Vitalii Demianets
2012-11-27 22:43 ` Hans J. Koch
2012-11-28  8:58   ` Vitalii Demianets
2012-11-28 21:05     ` Hans J. Koch
2012-11-29 16:05       ` Tux9
2012-11-29 16:22         ` Vitalii Demianets
2012-11-29 16:33           ` Cong Ding
2012-11-29 16:36           ` Vitalii Demianets
2012-11-29 23:58             ` Hans J. Koch
2012-11-30 11:12               ` Tux9
2012-11-30 21:33                 ` Hans J. Koch
2012-12-01  1:22                   ` Cong Ding
2012-12-01  3:56                     ` Hans J. Koch
2012-12-01  9:58                       ` Cong Ding
2012-12-03  7:51                         ` Hans J. Koch
2012-11-30 11:16               ` Vitalii Demianets
2012-11-30 21:39                 ` Hans J. Koch
2012-11-30 23:43                   ` Greg Kroah-Hartman
2012-12-03  7:41                     ` [PATCH] stable: uio: " Hans J. Koch
2012-12-03 13:38                       ` Ben Hutchings
2012-12-03  8:35                   ` [PATCH] uio.c: " Vitalii Demianets
2012-12-03  8:53                     ` Vitalii Demianets
2012-12-03 17:27                       ` Hans J. Koch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).