diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-08-16 22:09:28 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-08-16 22:09:28 +0200 |
commit | 566484a9e84c89d9875e8d5d1aac3dbc2d8f0ff4 (patch) | |
tree | c8452f6d7923998e362ddf3353e6a4ab082f04f7 /drivers/block | |
parent | block: change return type to bool (diff) | |
download | linux-566484a9e84c89d9875e8d5d1aac3dbc2d8f0ff4.tar.xz linux-566484a9e84c89d9875e8d5d1aac3dbc2d8f0ff4.zip |
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')
-rw-r--r-- | drivers/block/pktcdvd.c | 1 |
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; |