Module Name:    src
Committed By:   kre
Date:           Tue May  1 21:26:41 UTC 2018

Modified Files:
        src/usr.sbin/sysinst: partman.c

Log Message:
PR install/53220

Don't call pm_lvm_find() unless have_lvm

pm_lvm_find() assumes that data structs (lvms) has been allocated
for it to use, which doesn't happen if !have_lvm

This avoids a sysinst core dump when the lvm command is not installed
(such as when installing from the embedded RAM root filesys in an
INSTALL kernel.)


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/sysinst/partman.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.19 src/usr.sbin/sysinst/partman.c:1.20
--- src/usr.sbin/sysinst/partman.c:1.19	Tue May  1 08:27:39 2018
+++ src/usr.sbin/sysinst/partman.c	Tue May  1 21:26:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.19 2018/05/01 08:27:39 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.20 2018/05/01 21:26:41 kre Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -2609,7 +2609,8 @@ pm_upddevlist(menudesc *m, void *arg)
 			pm_i->found = 0;
 	/* Detect all present devices */
 	(void)find_disks("partman");
-	pm_lvm_find();
+	if (have_lvm)
+		pm_lvm_find();
 	pm_clean();
 
 	if (m == NULL || arg == NULL)

Reply via email to