changeset 12952:982975ba6eba

6968539 sof_setsockopt_impl suffers from USE_AFTER_FREE 6968540 unused value in sockparams_filter_cleanup_impl
author Anil udupa <anil.udupa@sun.com>
date Wed, 28 Jul 2010 14:00:54 -0700
parents 21b9be7f3041
children 2df46ea8f1b1
files usr/src/uts/common/fs/sockfs/sockfilter.c usr/src/uts/common/fs/sockfs/sockparams.c
diffstat 2 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/sockfs/sockfilter.c	Wed Jul 28 15:51:36 2010 -0400
+++ b/usr/src/uts/common/fs/sockfs/sockfilter.c	Wed Jul 28 14:00:54 2010 -0700
@@ -254,7 +254,6 @@
 			    (sof_handle_t)inst, so->so_family, so->so_type,
 			    so->so_protocol, cr, &inst->sofi_cookie);
 			if (rval != SOF_RVAL_CONTINUE) {
-				sof_instance_destroy(inst);
 				switch (rval) {
 				case SOF_RVAL_DETACH:
 					/*
@@ -272,6 +271,7 @@
 					error = sof_rval2errno(rval);
 					break;
 				}
+				sof_instance_destroy(inst);
 				return (error);
 			}
 		}
--- a/usr/src/uts/common/fs/sockfs/sockparams.c	Wed Jul 28 15:51:36 2010 -0400
+++ b/usr/src/uts/common/fs/sockfs/sockparams.c	Wed Jul 28 14:00:54 2010 -0700
@@ -773,7 +773,6 @@
 	    sp = list_next(list, sp)) {
 		flist = (ent->sofe_flags & SOFEF_AUTO) ?
 		    &sp->sp_auto_filters : &sp->sp_prog_filters;
-		fil = list_head(flist);
 		for (fil = list_head(flist); fil != NULL;
 		    fil = list_next(flist, fil)) {
 			if (fil->spf_filter == ent) {