Files
linux/drivers/block
Dan Carpenter 49379e6d1e ataflop: fix error handling in atari_floppy_init()
Smatch complains that there is an off by one if the allocation fails in:

	DMABuffer = atari_stram_alloc(BUFFER_SIZE+512, "ataflop");

In that situation, "i" would be point to one element beyond the end of
the unit[] array.

There is a second bug because the error handling calls
blk_mq_free_tag_set(&unit[i].tag_set); regardless of whether
"disk->queue" is NULL or non-NULL.  So if blk_mq_init_sq_queue() fails,
then that means unit[i].tag_set->tags is NULL and it leads to an Oops.

It's easiest to call put_disk() before the goto to clean up the partial
iteration.  Then the earlier unit[] elements are fully allocated so we
can remove the checks whether "disk->queue" is NULL and the code is
simpler.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-11-29 08:16:06 -07:00
..
2018-10-16 09:49:52 -06:00
2018-10-17 09:42:30 -06:00
2018-10-17 09:42:30 -06:00
2018-10-15 20:07:56 -06:00
2017-02-20 12:16:15 +01:00
2018-11-10 08:03:47 -07:00
2017-08-18 08:45:29 -06:00
2018-10-16 09:49:36 -06:00
2009-03-26 21:15:27 +01:00
2018-10-16 09:49:18 -06:00
2018-11-09 08:14:14 -07:00
2018-11-07 13:44:59 -07:00
2018-10-15 20:08:24 -06:00