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

[lvm-devel] [PATCH 20/20] Add internal error if pointer is uninitialized



Add simple check for existance of 'pl'.

Signed-off-by: Zdenek Kabelac <zkabelac redhat com>
---
 lib/format_pool/disk_rep.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/lib/format_pool/disk_rep.c b/lib/format_pool/disk_rep.c
index 2c16f50..ca8bfd7 100644
--- a/lib/format_pool/disk_rep.c
+++ b/lib/format_pool/disk_rep.c
@@ -263,6 +263,11 @@ static int _read_vg_pds(const struct format_type *fmt, struct dm_pool *mem,
 		 */
 		if (!sp_count) {
 			/* FIXME pl left uninitialised if !info->dev */
+			if (!pl) {
+				log_error(INTERNAL_ERROR "device is missing");
+				dm_pool_destroy(tmpmem);
+				return 0;
+			}
 			sp_count = pl->pd.pl_subpools;
 			if (!(sp_devs =
 			      dm_pool_zalloc(tmpmem,
-- 
1.7.3.3


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