svn commit: r364463 - head/sys/cam/ctl

Alexander Motin mav at FreeBSD.org
Fri Aug 21 20:10:30 UTC 2020


Author: mav
Date: Fri Aug 21 20:10:29 2020
New Revision: 364463
URL: https://svnweb.freebsd.org/changeset/base/364463

Log:
  Fix CTL ioctl port creation error handling.
  
  Submitted by:	Bret Ketchum
  MFC after:	3 days
  Differential Revision:	https://reviews.freebsd.org/D26143

Modified:
  head/sys/cam/ctl/ctl_frontend_ioctl.c

Modified: head/sys/cam/ctl/ctl_frontend_ioctl.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_ioctl.c	Fri Aug 21 19:34:41 2020	(r364462)
+++ head/sys/cam/ctl/ctl_frontend_ioctl.c	Fri Aug 21 20:10:29 2020	(r364463)
@@ -226,7 +226,7 @@ cfi_ioctl_port_create(struct ctl_req *req)
 		req->status = CTL_LUN_ERROR;
 		snprintf(req->error_str, sizeof(req->error_str),
 		    "ctl_port_register() failed with error %d", retval);
-		free(port, M_CTL);
+		free(cfi, M_CTL);
 		return;
 	}
 
@@ -247,7 +247,9 @@ cfi_ioctl_port_create(struct ctl_req *req)
 		req->status = CTL_LUN_ERROR;
 		snprintf(req->error_str, sizeof(req->error_str),
 		    "make_dev_s() failed with error %d", retval);
-		free(port, M_CTL);
+		ctl_port_offline(port);
+		ctl_port_deregister(port);
+		free(cfi, M_CTL);
 		return;
 	}
 


More information about the svn-src-head mailing list