aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl/ctl_frontend_ioctl.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2020-08-21 20:10:29 +0000
committerAlexander Motin <mav@FreeBSD.org>2020-08-21 20:10:29 +0000
commit7758c80f74763a938a186cfba7dbef9c9bc6692b (patch)
tree63c45f64ccc4fa94bc8ba05f09892cc2cfc1e927 /sys/cam/ctl/ctl_frontend_ioctl.c
parentab1c54fec66803235a8923333fa79f2cbfa33354 (diff)
downloadsrc-7758c80f74763a938a186cfba7dbef9c9bc6692b.tar.gz
src-7758c80f74763a938a186cfba7dbef9c9bc6692b.zip
Fix CTL ioctl port creation error handling.
Submitted by: Bret Ketchum MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26143
Notes
Notes: svn path=/head/; revision=364463
Diffstat (limited to 'sys/cam/ctl/ctl_frontend_ioctl.c')
-rw-r--r--sys/cam/ctl/ctl_frontend_ioctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/cam/ctl/ctl_frontend_ioctl.c b/sys/cam/ctl/ctl_frontend_ioctl.c
index 24c624cc38d2..0280391242d2 100644
--- a/sys/cam/ctl/ctl_frontend_ioctl.c
+++ b/sys/cam/ctl/ctl_frontend_ioctl.c
@@ -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;
}