]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen-traditional.git/commit
hw/device-hotplug: fix test of drive_add() return
authorKaifeng Zhu <kaifeng.zhu@citrix.com>
Fri, 7 Mar 2014 15:16:42 +0000 (15:16 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 16 Oct 2015 15:52:06 +0000 (16:52 +0100)
commit2c69a0bb9e3b96bb041abf221323599976a4760c
tree2978b16bfcf572fdc4ceecc2c355d4f866efbf51
parentec5080d57c87e1ace8d76e12261ce660594516f8
hw/device-hotplug: fix test of drive_add() return

drive_opt_idx could be -1 in case error occurs inside drive_add, so the error
check should be "if (drive_opt_idx < 0)" instead of original
"if (!drive_opt_idx)".

Signed-off-by: Kaifeng Zhu <kaifeng.zhu@citrix.com>
Coverity-ID: 1055574
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
hw/device-hotplug.c