Don't free k_cfg until we're finished using it -- reverse the order of

two free commands.

Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor), scottl
This commit is contained in:
cperciva 2004-02-22 09:55:48 +00:00
parent e4a1f86f9c
commit 11443ed5cb

View File

@ -515,9 +515,9 @@ raidctlioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
(caddr_t) specific_buf,
k_cfg->layoutSpecificSize);
if (retcode) {
RF_Free(k_cfg, sizeof(RF_Config_t));
RF_Free(specific_buf,
k_cfg->layoutSpecificSize);
RF_Free(k_cfg, sizeof(RF_Config_t));
rf_printf(2, "raidctlioctl: retcode=%d "
"copyin.2\n", retcode);
return (retcode);