Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2018 14:03:39 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331548 - head/sys/arm/allwinner
Message-ID:  <201803261403.w2QE3dA9021285@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Mon Mar 26 14:03:39 2018
New Revision: 331548
URL: https://svnweb.freebsd.org/changeset/base/331548

Log:
  aw_sid(4): Release resources and destroy mutex on failure
  
  Submitted by:	Eugene Sevastyanov <eval@iptk.ru>

Modified:
  head/sys/arm/allwinner/aw_sid.c

Modified: head/sys/arm/allwinner/aw_sid.c
==============================================================================
--- head/sys/arm/allwinner/aw_sid.c	Mon Mar 26 13:45:17 2018	(r331547)
+++ head/sys/arm/allwinner/aw_sid.c	Mon Mar 26 14:03:39 2018	(r331548)
@@ -207,7 +207,7 @@ aw_sid_attach(device_t dev)
 		for (i = 0; i < sc->sid_conf->efuse_size; i += 4)
 			if (aw_sid_prctl_read(dev, i, &val) != 0) {
 				device_printf(dev, "failed prctl read\n");
-				return (ENXIO);
+				goto fail;
 			}
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
@@ -217,6 +217,11 @@ aw_sid_attach(device_t dev)
 	    dev, AW_SID_ROOT_KEY, aw_sid_sysctl, "A", "Root Key");
 
 	return (0);
+
+fail:
+	bus_release_resources(dev, aw_sid_spec, &sc->res);
+	mtx_destroy(&sc->prctl_mtx);
+	return (ENXIO);
 }
 
 int



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