Skip to content

Commit 566484a

Browse files
committed
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 599d067 commit 566484a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/block/pktcdvd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,6 +2740,7 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev)
27402740
pd->write_congestion_on = write_congestion_on;
27412741
pd->write_congestion_off = write_congestion_off;
27422742

2743+
ret = -ENOMEM;
27432744
disk = alloc_disk(1);
27442745
if (!disk)
27452746
goto out_mem;

0 commit comments

Comments
 (0)