]> git.proxmox.com Git - mirror_qemu.git/commit
spapr_nvram: Check return value from blk_getlength()
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 5 Jun 2017 15:14:17 +0000 (16:14 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 5 Jun 2017 23:18:32 +0000 (09:18 +1000)
commit052495178821fdc97b4125a8677c1b68eb458db9
tree7cec3859cf8af0c77d26f8a1bcea97d7f2eeb590
parent60694bc67837ac1678fa9d67e0f5f83f8cf5436e
spapr_nvram: Check return value from blk_getlength()

The blk_getlength() function can return an error value if the
image size cannot be determined. Check for this rather than
ploughing on and trying to g_malloc0() a negative number.
(Spotted by Coverity, CID 1288484.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/nvram/spapr_nvram.c