Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Sep 2020 18:26:36 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365334 - head/sys/dev/usb/storage
Message-ID:  <202009041826.084IQaWX001534@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Fri Sep  4 18:26:35 2020
New Revision: 365334
URL: https://svnweb.freebsd.org/changeset/base/365334

Log:
  umass: fix a cam_sim leak in error case
  
  While debugging a hang I noticed that in case of error in
  umass_cam_attach_sim() we miss a cam_sim_free() call.
  Added that to not leak resources.
  
  Reviewed by:	hselasky
  MFC after:	3 days
  Differential Revision:	D26287

Modified:
  head/sys/dev/usb/storage/umass.c

Modified: head/sys/dev/usb/storage/umass.c
==============================================================================
--- head/sys/dev/usb/storage/umass.c	Fri Sep  4 18:18:05 2020	(r365333)
+++ head/sys/dev/usb/storage/umass.c	Fri Sep  4 18:26:35 2020	(r365334)
@@ -2094,6 +2094,7 @@ umass_cam_attach_sim(struct umass_softc *sc)
 
 	if (xpt_bus_register(sc->sc_sim, sc->sc_dev,
 	    sc->sc_unit) != CAM_SUCCESS) {
+		cam_sim_free(sc->sc_sim, /* free_devq */ TRUE);
 		mtx_unlock(&sc->sc_mtx);
 		return (ENOMEM);
 	}



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