From owner-freebsd-current@FreeBSD.ORG Sat Feb 1 19:11:33 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C929600 for ; Sat, 1 Feb 2014 19:11:33 +0000 (UTC) Received: from forward7l.mail.yandex.net (forward7l.mail.yandex.net [IPv6:2a02:6b8:0:1819::7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDF62165D for ; Sat, 1 Feb 2014 19:11:32 +0000 (UTC) Received: from smtp3h.mail.yandex.net (smtp3h.mail.yandex.net [84.201.186.20]) by forward7l.mail.yandex.net (Yandex) with ESMTP id 78E39BC0ED8 for ; Sat, 1 Feb 2014 23:11:21 +0400 (MSK) Received: from smtp3h.mail.yandex.net (localhost [127.0.0.1]) by smtp3h.mail.yandex.net (Yandex) with ESMTP id 36FBC1B42B29 for ; Sat, 1 Feb 2014 23:11:21 +0400 (MSK) Received: from 78.108.206.159.tel.ru (78.108.206.159.tel.ru [78.108.206.159]) by smtp3h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LX0vm2KlgD-BKmOVMSK; Sat, 1 Feb 2014 23:11:20 +0400 (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (Client certificate not present) X-Yandex-Uniq: f2d6797c-5d35-4f16-b585-ba96d769eec1 Message-ID: <52ED46D8.9050001@passap.ru> Date: Sat, 01 Feb 2014 23:11:20 +0400 From: Boris Samorodov Organization: =?UTF-8?B?0JfQkNCeICLQktCQ0KDQoiI=?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: FreeBSD CURRENT Subject: [patch: libc/rpc/svc_vc.c] clang analyser: Branch condition evaluates to a garbage value X-Enigmail-Version: 1.6 Content-Type: multipart/mixed; boundary="------------040004010101000405080101" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2014 19:11:33 -0000 This is a multi-part message in MIME format. --------------040004010101000405080101 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi All, While using clang static analyzer at CURRENT (r261322) I got: http://gw.wart.ru/2014-02-01-200848-39517-1/report-01bc48.html There is no need at line 143 to "goto cleanup_svc_vc_create" (neither xprt nor r are allocated so far). Just "return NULL" should be fine. BTW, NetBSD do the latter as well. So I propose a tiny patch (attached). -- WBR, Boris Samorodov (bsam) FreeBSD Committer, http://www.FreeBSD.org The Power To Serve --------------040004010101000405080101 Content-Type: text/plain; charset=UTF-8; name="libc-rpc-svc_vc.c.diff.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="libc-rpc-svc_vc.c.diff.txt" SW5kZXg6IC91c3Ivc3JjL2xpYi9saWJjL3JwYy9zdmNfdmMuYwo9PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0t LSAvdXNyL3NyYy9saWIvbGliYy9ycGMvc3ZjX3ZjLmMJKHJldmlzaW9uIDI2MDAzNikKKysr IC91c3Ivc3JjL2xpYi9saWJjL3JwYy9zdmNfdmMuYwkod29ya2luZyBjb3B5KQpAQCAtMTQx LDcgKzE0MSw3IEBACiAJciA9IG1lbV9hbGxvYyhzaXplb2YoKnIpKTsKIAlpZiAociA9PSBO VUxMKSB7CiAJCXdhcm54KCJzdmNfdmNfY3JlYXRlOiBvdXQgb2YgbWVtb3J5Iik7Ci0JCWdv dG8gY2xlYW51cF9zdmNfdmNfY3JlYXRlOworCQlyZXR1cm4gTlVMTDsKIAl9CiAJci0+c2Vu ZHNpemUgPSBfX3JwY19nZXRfdF9zaXplKHNpLnNpX2FmLCBzaS5zaV9wcm90bywgKGludClz ZW5kc2l6ZSk7CiAJci0+cmVjdnNpemUgPSBfX3JwY19nZXRfdF9zaXplKHNpLnNpX2FmLCBz aS5zaV9wcm90bywgKGludClyZWN2c2l6ZSk7Cg== --------------040004010101000405080101--