OSDN Git Service

If we cannot create a new PedDisk for the device we're looking at, return NULL rather...
authorDavid Cantrell <dcantrel@mortise.boston.redhat.com>
Tue, 31 Jul 2007 17:59:27 +0000 (13:59 -0400)
committerDavid Cantrell <dcantrel@mortise.boston.redhat.com>
Tue, 31 Jul 2007 19:03:37 +0000 (15:03 -0400)
(cherry picked from commit 865ea3d3f2eb7918b64a00825dfa44e05651e2ad)

libparted/device.c

index cbf5a38..6cee5aa 100644 (file)
@@ -189,6 +189,10 @@ ped_device_get (const char* path)
        ped_free (normal_path);
        if (!walk)
                return NULL;
+
+       if (!ped_disk_new (walk))
+               return NULL;
+
        _device_register (walk);
        return walk;
 }