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

Alexander Motin mav at FreeBSD.org
Wed Sep 10 06:29:32 UTC 2014


Author: mav
Date: Wed Sep 10 06:29:31 2014
New Revision: 271353
URL: http://svnweb.freebsd.org/changeset/base/271353

Log:
  Fix memory leak on error, reported by Coverity.
  
  CID:		1007773

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

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Wed Sep 10 06:25:18 2014	(r271352)
+++ head/sys/cam/ctl/ctl.c	Wed Sep 10 06:29:31 2014	(r271353)
@@ -2899,6 +2899,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		lun = softc->ctl_luns[err_desc->lun_id];
 		if (lun == NULL) {
 			mtx_unlock(&softc->ctl_lock);
+			free(new_err_desc, M_CTL);
 			printf("%s: CTL_ERROR_INJECT: invalid LUN %ju\n",
 			       __func__, (uintmax_t)err_desc->lun_id);
 			retval = EINVAL;


More information about the svn-src-all mailing list