On 02/25/2020 03:30 PM, Peter Maydell wrote:
On Fri, 21 Feb 2020 at 03:37, David Gibson <da...@gibson.dropbear.id.au> wrote:
From: Shivaprasad G Bhat <sb...@linux.ibm.com>

Add support for NVDIMM devices for sPAPR. Piggyback on existing nvdimm
device interface in QEMU to support virtual NVDIMM devices for Power.
+    }
+
+    uuidstr = object_property_get_str(OBJECT(nvdimm), NVDIMM_UUID_PROP, NULL);
+    qemu_uuid_parse(uuidstr, &uuid);
+    g_free(uuidstr);
+
+    if (qemu_uuid_is_null(&uuid)) {
+        error_setg(errp, "NVDIMM device requires the uuid to be set");
+        return;
+    }
+}
Hi -- Coverity thinks (CID 1419883) that it's suspicious that
this code doesn't check the return value of qemu_uuid_parse(),
because we check it everywhere else that we call that function
(it can return a failure code if the UUID doesn't validly parse).
Hi Peter,

The nvdimm_set_uuid() already verifies if the uuid is valid or not. So, its safe
if we dont check here again.

I just posted a patch adding an assert here.

Thanks and Regards,
Shivaprasad


Reply via email to