Re: [Qemu-devel] [PATCH] spapr_nvram: Check return value from blk_getlength()

2017-06-05 Thread David Gibson
On Mon, Jun 05, 2017 at 04:14:17PM +0100, Peter Maydell wrote: > 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.) > >

[Qemu-devel] [PATCH] spapr_nvram: Check return value from blk_getlength()

2017-06-05 Thread Peter Maydell
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 ---