Re: [PATCH] vbox: Prevent from registering storage driver with NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 03, 2014 at 11:32:41PM +0800, Taowei Luo wrote:
Since 5892944fc853 the virRegisterStorageDriver may be called with
a NULL storageDriver if it failed on vboxGetStorageDriver.
So make sure the storageDriver is not NULL before register.

---
src/vbox/vbox_driver.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


Already in as commit v1.2.10-3-g55bbc34 that was waiting post release:

commit 55bbc342183a721170be641efac6166bb0cf65d9
Author: Martin Kletzander <mkletzan@xxxxxxxxxx>
Date:   Thu Oct 30 09:56:26 2014 +0100

   vbox: don't register NULL driver

diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c
index c64d2d6..b2e35e9 100644
--- a/src/vbox/vbox_driver.c
+++ b/src/vbox/vbox_driver.c
@@ -74,7 +74,7 @@ int vboxStorageRegister(void)
    if (VBoxCGlueInit(&uVersion) == 0)
        storageDriver = vboxGetStorageDriver(uVersion);

-    if (virRegisterStorageDriver(storageDriver) < 0)
+    if (storageDriver && virRegisterStorageDriver(storageDriver) < 0)
        return -1;
    return 0;
}
--
1.7.9.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]