[libvirt] [PATCH] openvzRegister: Check for error return

A recent change to openvz_driver.c caused Coverity to make additional comparisons and find that the openvzRegister() was not checking the status of virRegisterDriver() call like other callers and thus generated a CHECKED_RETURN condition Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/openvz/openvz_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 393f397..c10fa05 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -2239,6 +2239,7 @@ static virDriver openvzDriver = { }; int openvzRegister(void) { - virRegisterDriver(&openvzDriver); + if (virRegisterDriver(&openvzDriver) < 0) + return -1; return 0; } -- 1.8.5.3

On Fri, Mar 14, 2014 at 06:45:59AM -0400, John Ferlan wrote:
A recent change to openvz_driver.c caused Coverity to make additional comparisons and find that the openvzRegister() was not checking the status of virRegisterDriver() call like other callers and thus generated a CHECKED_RETURN condition
Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/openvz/openvz_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
ACK Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
John Ferlan