summaryrefslogtreecommitdiff
path: root/drivers/block/pktcdvd.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-08-16 14:09:28 -0600
committerJens Axboe <axboe@kernel.dk>2018-08-16 14:09:28 -0600
commit566484a9e84c89d9875e8d5d1aac3dbc2d8f0ff4 (patch)
treec8452f6d7923998e362ddf3353e6a4ab082f04f7 /drivers/block/pktcdvd.c
parent599d067dd3c1b9697b786c992b17cd6529c0459c (diff)
pktcdvd: fix setting of 'ret' error return for a few cases
We initialize it to -ENOMEM, but then later overwrite it. After overwriting, we don't set it again for two later failure cases. Reported-by: Jason Wood <jasonwood2031@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/pktcdvd.c')
-rw-r--r--drivers/block/pktcdvd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index e285413d4a75..6f1d25c1eb64 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2740,6 +2740,7 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev)
pd->write_congestion_on = write_congestion_on;
pd->write_congestion_off = write_congestion_off;
+ ret = -ENOMEM;
disk = alloc_disk(1);
if (!disk)
goto out_mem;