All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] BLOCK: rbd, return proper error from rbd_dev_probe_update_spec
@ 2013-04-04 20:32 Jiri Slaby
  2013-04-04 20:32 ` [PATCH 2/5] MEDIA: ttusbir, fix double free Jiri Slaby
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Jiri Slaby @ 2013-04-04 20:32 UTC (permalink / raw)
  To: jirislaby; +Cc: linux-kernel

ret might be uninitialized and is returned that way when kstrdup of
rbd_dev->spec->snap_name fails. Fix it by returning ENOMEM from that
place.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/block/rbd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 6b2b039..3417f34 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3113,8 +3113,10 @@ static int rbd_dev_probe_update_spec(struct rbd_device *rbd_dev)
 		goto out_err;
 	}
 	rbd_dev->spec->snap_name = kstrdup(name, GFP_KERNEL);
-	if(!rbd_dev->spec->snap_name)
+	if(!rbd_dev->spec->snap_name) {
+		ret = -ENOMEM;
 		goto out_err;
+	}
 
 	return 0;
 out_err:
-- 
1.8.2



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

end of thread, other threads:[~2013-04-09 10:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 20:32 [PATCH 1/5] BLOCK: rbd, return proper error from rbd_dev_probe_update_spec Jiri Slaby
2013-04-04 20:32 ` [PATCH 2/5] MEDIA: ttusbir, fix double free Jiri Slaby
2013-04-09 10:36   ` Sean Young
2013-04-04 20:32 ` [PATCH 3/5] SOUND: hda_generic, fix uninitialized variable Jiri Slaby
2013-04-05  5:20   ` Takashi Iwai
2013-04-04 20:32 ` [PATCH 4/5] X86: boot, close opened descriptor Jiri Slaby
2013-04-04 20:32 ` [PATCH 5/5] HID: hid-lenovo-tpkbd, remove doubled hid_get_drvdata Jiri Slaby
2013-04-04 22:37   ` Jiri Kosina
2013-04-04 23:05   ` Nikola Pajkovsky
2013-04-04 22:53 ` [PATCH 1/5] BLOCK: rbd, return proper error from rbd_dev_probe_update_spec Nikola Pajkovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.