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>
This commit is contained in:
Jens Axboe 2018-08-16 14:09:28 -06:00
parent 599d067dd3
commit 566484a9e8

View file

@ -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;