Author: cem
Date: Wed Apr 20 05:13:36 2016
New Revision: 298340
URL: https://svnweb.freebsd.org/changeset/base/298340

Log:
  sym(4): Don't double-free 'sim' in failure case
  
  Reported by:  Coverity
  CID:          1006106
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/dev/sym/sym_hipd.c

Modified: head/sys/dev/sym/sym_hipd.c
==============================================================================
--- head/sys/dev/sym/sym_hipd.c Wed Apr 20 05:11:00 2016        (r298339)
+++ head/sys/dev/sym/sym_hipd.c Wed Apr 20 05:13:36 2016        (r298340)
@@ -8890,6 +8890,7 @@ static int sym_cam_attach(hcb_p np)
        if (xpt_bus_register(sim, np->device, 0) != CAM_SUCCESS)
                goto fail;
        np->sim = sim;
+       sim = NULL;
 
        if (xpt_create_path(&path, NULL,
                            cam_sim_path(np->sim), CAM_TARGET_WILDCARD,
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to