From 566484a9e84c89d9875e8d5d1aac3dbc2d8f0ff4 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 16 Aug 2018 14:09:28 -0600 Subject: 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 Signed-off-by: Jens Axboe --- drivers/block/pktcdvd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/block') 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; -- cgit v1.2.3