Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jun 2014 21:50:46 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267429 - head/sys/cam/ctl
Message-ID:  <201406122150.s5CLokrb081459@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Jun 12 21:50:46 2014
New Revision: 267429
URL: http://svnweb.freebsd.org/changeset/base/267429

Log:
  Fix some leaks on LUN creation error.
  
  MFC after:	2 weeks

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

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Thu Jun 12 21:36:17 2014	(r267428)
+++ head/sys/cam/ctl/ctl_backend_block.c	Thu Jun 12 21:50:46 2014	(r267429)
@@ -2113,9 +2113,14 @@ ctl_be_block_create(struct ctl_be_block_
 bailout_error:
 	req->status = CTL_LUN_ERROR;
 
+	if (be_lun->io_taskqueue != NULL)
+		taskqueue_free(be_lun->io_taskqueue);
 	ctl_be_block_close(be_lun);
-
-	free(be_lun->dev_path, M_CTLBLK);
+	if (be_lun->dev_path != NULL)
+		free(be_lun->dev_path, M_CTLBLK);
+	if (be_lun->lun_zone != NULL)
+		uma_zdestroy(be_lun->lun_zone);
+	mtx_destroy(&be_lun->lock);
 	free(be_lun, M_CTLBLK);
 
 	return (retval);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406122150.s5CLokrb081459>