diff options
author | Dan Carpenter <[email protected]> | 2021-04-21 13:18:35 +0300 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2021-04-21 09:15:25 -0600 |
commit | 1ffec389a6431782a8a28805830b6fae9bf00af1 (patch) | |
tree | 5eb749bdeb0c889294504c4232ea0977d0f9966b /include/linux/overflow.h | |
parent | 6327c911aa69bdf0c5f21a44970eab6dba213dde (diff) |
ataflop: potential out of bounds in do_format()
The function uses "type" as an array index:
q = unit[drive].disk[type]->queue;
Unfortunately the bounds check on "type" isn't done until later in the
function. Fix this by moving the bounds check to the start.
Fixes: bf9c0538e485 ("ataflop: use a separate gendisk for each media format")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'include/linux/overflow.h')
0 files changed, 0 insertions, 0 deletions