svn commit: r361252 - stable/12/sys/cam/ctl

Alexander Motin mav at FreeBSD.org
Tue May 19 13:52:35 UTC 2020


Author: mav
Date: Tue May 19 13:52:34 2020
New Revision: 361252
URL: https://svnweb.freebsd.org/changeset/base/361252

Log:
  MFC r359686: Fix panic on kern.cam.ctl.ha_role change after r333446.

Modified:
  stable/12/sys/cam/ctl/ctl_backend_block.c
  stable/12/sys/cam/ctl/ctl_backend_ramdisk.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- stable/12/sys/cam/ctl/ctl_backend_block.c	Tue May 19 13:44:32 2020	(r361251)
+++ stable/12/sys/cam/ctl/ctl_backend_block.c	Tue May 19 13:52:34 2020	(r361252)
@@ -2586,8 +2586,10 @@ ctl_be_block_modify(struct ctl_be_block_softc *softc, 
 	if (params->lun_size_bytes != 0)
 		be_lun->params.lun_size_bytes = params->lun_size_bytes;
 
-	nvlist_destroy(cbe_lun->options);
-	cbe_lun->options = nvlist_clone(req->args_nvl);
+	if (req->args_nvl != NULL) {
+		nvlist_destroy(cbe_lun->options);
+		cbe_lun->options = nvlist_clone(req->args_nvl);
+	}
 
 	wasprim = (cbe_lun->flags & CTL_LUN_FLAG_PRIMARY);
 	value = dnvlist_get_string(cbe_lun->options, "ha_role", NULL);

Modified: stable/12/sys/cam/ctl/ctl_backend_ramdisk.c
==============================================================================
--- stable/12/sys/cam/ctl/ctl_backend_ramdisk.c	Tue May 19 13:44:32 2020	(r361251)
+++ stable/12/sys/cam/ctl/ctl_backend_ramdisk.c	Tue May 19 13:52:34 2020	(r361252)
@@ -1252,8 +1252,10 @@ ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc
 	if (params->lun_size_bytes != 0)
 		be_lun->params.lun_size_bytes = params->lun_size_bytes;
 
-	nvlist_destroy(cbe_lun->options);
-	cbe_lun->options = nvlist_clone(req->args_nvl);
+	if (req->args_nvl != NULL) {
+		nvlist_destroy(cbe_lun->options);
+		cbe_lun->options = nvlist_clone(req->args_nvl);
+	}
 
 	wasprim = (cbe_lun->flags & CTL_LUN_FLAG_PRIMARY);
 	value = dnvlist_get_string(cbe_lun->options, "ha_role", NULL);


More information about the svn-src-stable mailing list