From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuGFd-0002A5-0T for qemu-devel@nongnu.org; Fri, 28 Nov 2014 02:46:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuGFW-0007LI-Ne for qemu-devel@nongnu.org; Fri, 28 Nov 2014 02:46:00 -0500 Message-ID: <54782743.2020201@huawei.com> Date: Fri, 28 Nov 2014 15:41:55 +0800 From: Gonglei MIME-Version: 1.0 References: <1415881027-8112-1-git-send-email-arei.gonglei@huawei.com> <1415881027-8112-3-git-send-email-arei.gonglei@huawei.com> <87h9xkkdxx.fsf@blackfin.pond.sub.org> <5477D530.7030101@huawei.com> <87lhmv9419.fsf@blackfin.pond.sub.org> In-Reply-To: <87lhmv9419.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] virtfs-proxy-helper: Fix handle leak to make Coverity happy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: "qemu-trivial@nongnu.org" , "aneesh.kumar@linux.vnet.ibm.com" , "Huangpeng (Peter)" , "qemu-devel@nongnu.org" On 2014/11/28 15:29, Markus Armbruster wrote: > Since this is main(), the "caller" is the OS. And yes, the OS closes > the -f file descriptor when main() returns, because it closes *all* file > descriptors. Calling close() before return from main() is pointless, > unless you check for errors. > > Unfortunately, Coverity doesn't understand this. Calling close() in > main() suppresses its bogus defect report. > Yes. >>> >> If sock >= 0 is pointless, too, but needed to hush up Coverity. >> > >> > You mean do not check sock_name is NULL or not? > Yes, unless it causes another bogus Coverity defect. > > Or simply mark the defect as invalid and move on without patching the > code. Let's drop this patch, thanks. Regards, -Gonglei