Fix CTL ioctl port creation error handling.

Submitted by:	Bret Ketchum
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26143
This commit is contained in:
Alexander Motin 2020-08-21 20:10:29 +00:00
parent ab1c54fec6
commit 7758c80f74
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=364463

View File

@ -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;
}