]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
gdrom: Add missing error code
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 6 Feb 2017 22:00:13 +0000 (23:00 +0100)
committerJens Axboe <axboe@fb.com>
Tue, 7 Feb 2017 23:17:16 +0000 (16:17 -0700)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/cdrom/gdrom.c

index 584bc3126403d58955a915db2117fcd1d16de5a2..46ecd95d71616d6e84e0c8f9c3f720edb32b73ac 100644 (file)
@@ -807,16 +807,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;