Date: Thu, 30 Mar 2006 21:17:08 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 94326 for review Message-ID: <200603302117.k2ULH81p086654@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=94326 Change 94326 by jhb@jhb_slimer on 2006/03/30 21:16:27 More cleanups and fix kld_unlock in linker_file_lookup_set(). Affected files ... .. //depot/projects/smpng/sys/kern/kern_linker.c#54 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_linker.c#54 (text+ko) ==== @@ -639,7 +639,8 @@ if (!locked) KLD_LOCK(); error = linker_lookup_set(file, name, firstp, lastp, countp); - KLD_UNLOCK(); + if (!locked) + KLD_UNLOCK(); return (error); } @@ -844,10 +845,8 @@ KLD_LOCK(); error = linker_load_module_internal(kldname, modname, NULL, NULL, &lf); - if (error) { - KLD_UNLOCK(); - goto out; - } + if (error) + goto unlock; #ifdef HWPMC_HOOKS pkm.pm_file = lf->filename; pkm.pm_address = (uintptr_t) lf->address; @@ -855,6 +854,7 @@ #endif lf->userrefs++; td->td_retval[0] = lf->id; +unlock: KLD_UNLOCK(); out: free(pathname, M_TEMP); @@ -961,9 +961,9 @@ filename = linker_basename(pathname); KLD_LOCK(); lf = linker_find_file_by_name(filename); - if (lf) { + if (lf) td->td_retval[0] = lf->id; - } else + else error = ENOENT; KLD_UNLOCK(); out: @@ -1116,12 +1116,9 @@ KLD_LOCK(); if (uap->fileid != 0) { lf = linker_find_file_by_id(uap->fileid); - if (lf == NULL) { + if (lf == NULL) error = ENOENT; - KLD_UNLOCK(); - goto out; - } - if (LINKER_LOOKUP_SYMBOL(lf, symstr, &sym) == 0 && + else if (LINKER_LOOKUP_SYMBOL(lf, symstr, &sym) == 0 && LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0) { lookup.symvalue = (uintptr_t) symval.value; lookup.symsize = symval.size;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603302117.k2ULH81p086654>