Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 May 2014 22:44:16 GMT
From:      Myron Walker <myron.walker@emc.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/189845: UnNecessary Copy of Error Buffer in _kvm_open
Message-ID:  <201405152244.s4FMiGIh090509@cgiserv.freebsd.org>
Resent-Message-ID: <201405152250.s4FMo0EV025893@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         189845
>Category:       misc
>Synopsis:       UnNecessary Copy of Error Buffer in _kvm_open
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 15 22:50:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Myron Walker
>Release:        
>Organization:
EMC
>Environment:
mwwsoftcluster0# uname -a
FreeBSD mwwsoftcluster0 11.0-CURRENT FreeBSD 11.0-CURRENT #0: Mon May  5 10:30:09 PDT 2014     root@bsd10build01.west.isilon.com:/build/mnt/obj/build/mnt/src/sys/IQ.amd64.debug  amd64

>Description:
_kvm_open in libkvm always returns 0 on a failure.  So writing a message to kd is pointless because it is immediately passed to kvm_close() and the memory is freed.  Se the code snippet below from _kvm_open.

        /*
	 * Copy out the error if doing sane error semantics.
	 */
	if (errout != 0)
		strlcpy(errout, kd->errbuf, _POSIX2_LINE_MAX);
	(void)kvm_close(kd);
	return (0);
>How-To-Repeat:

>Fix:
All error message code can be removed from _kvm_open because none of it is used anyway.

>Release-Note:
>Audit-Trail:
>Unformatted:



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