Skip to contentSkip to conversation

master - report: Do not try to get dev_size of a NULL device.

PATCH Petr Rockai 1 participant 1 message Jan 13, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d61c9eb52f05de5da706b79b9596143fab628b8e
Commit:        d61c9eb52f05de5da706b79b9596143fab628b8e
Parent:        5f7286f15d34d89b6710af3946985b4479e2a472
Author:        Petr Rockai <[email protected]>
AuthorDate:    Mon Jan 13 11:45:18 2014 +0100
Committer:     Petr Rockai <[email protected]>
CommitterDate: Mon Jan 13 11:45:18 2014 +0100

report: Do not try to get dev_size of a NULL device.

---
 lib/report/report.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
lib/report/report.c +3 -0
index 2d39cb0..3626769 100644
@@ -695,6 +695,9 @@ static int _devsize_disp(struct dm_report *rh, struct dm_pool *mem,
 {
 	uint64_t size;
 
+	if (!data)
+		return _field_set_value(field, "", NULL);
+
 	if (!dev_get_size(*(const struct device **) data, &size))
 		return_0;