Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1575188 > unrolled thread

[PATCH] gdrom: Add missing error code

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-02-06 23:10 +0100
Last post2017-02-07 20:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] gdrom: Add missing error code Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-02-06 23:10 +0100
    Re: [PATCH] gdrom: Add missing error code Christoph Hellwig <hch@lst.de> - 2017-02-07 20:50 +0100

#1575188 — [PATCH] gdrom: Add missing error code

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-02-06 23:10 +0100
Subject[PATCH] gdrom: Add missing error code
Message-ID<t7ZDY-2rk-19@gated-at.bofh.it>
In case of error, 'err' is known to be 0 here, because of the previous
test. Set it to a -ENOMEM instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/cdrom/gdrom.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index b6f1a5d95bc5..bc316d288f65 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -808,16 +808,20 @@ static int probe_gdrom(struct platform_device *devptr)
 	if (err)
 		goto probe_fail_cmdirq_register;
 	gd.gdrom_rq = blk_init_queue(gdrom_request, &gdrom_lock);
-	if (!gd.gdrom_rq)
+	if (!gd.gdrom_rq) {
+		err = -ENOMEM;
 		goto probe_fail_requestq;
+	}
 
 	err = probe_gdrom_setupqueue();
 	if (err)
 		goto probe_fail_toc;
 
 	gd.toc = kzalloc(sizeof(struct gdromtoc), GFP_KERNEL);
-	if (!gd.toc)
+	if (!gd.toc) {
+		err = -ENOMEM;
 		goto probe_fail_toc;
+	}
 	add_disk(gd.disk);
 	return 0;
 
-- 
2.9.3

[toc] | [next] | [standalone]


#1575986

FromChristoph Hellwig <hch@lst.de>
Date2017-02-07 20:50 +0100
Message-ID<t8jW2-74w-27@gated-at.bofh.it>
In reply to#1575188
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web