mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
hw/ide/pci: Remove dead code from bmdma_prepare_buf()
Coverity notes that the code at the end of the loop in
bmdma_prepare_buf() is unreachable. This is because in commit
9fbf0fa81f
("ide: remove hardcoded 2GiB transactional limit")
we removed the only codepath in the loop which could "break" out of
it, but didn't notice that this meant we should also remove the code
at the end of the loop.
Remove the dead code.
Resolves: Coverity CID 1547772
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[PMD: Break and return once at EOF]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240805182419.22239-1-philmd@linaro.org>
This commit is contained in:
parent
11b4666161
commit
c1a6ae5145
1 changed files with 2 additions and 5 deletions
|
@ -237,7 +237,7 @@ static int32_t bmdma_prepare_buf(const IDEDMA *dma, int32_t limit)
|
|||
/* end of table (with a fail safe of one page) */
|
||||
if (bm->cur_prd_last ||
|
||||
(bm->cur_addr - bm->addr) >= BMDMA_PAGE_SIZE) {
|
||||
return s->sg.size;
|
||||
break;
|
||||
}
|
||||
pci_dma_read(pci_dev, bm->cur_addr, &prd, 8);
|
||||
bm->cur_addr += 8;
|
||||
|
@ -266,10 +266,7 @@ static int32_t bmdma_prepare_buf(const IDEDMA *dma, int32_t limit)
|
|||
s->io_buffer_size += l;
|
||||
}
|
||||
}
|
||||
|
||||
qemu_sglist_destroy(&s->sg);
|
||||
s->io_buffer_size = 0;
|
||||
return -1;
|
||||
return s->sg.size;
|
||||
}
|
||||
|
||||
/* return 0 if buffer completed */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue