From patchwork Wed Aug 1 08:59:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 174401 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 39EB22C00B9 for ; Wed, 1 Aug 2012 18:58:46 +1000 (EST) Received: from localhost ([::1]:54424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwUlQ-0007tK-BZ for incoming@patchwork.ozlabs.org; Wed, 01 Aug 2012 04:58:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwUlJ-0007t0-Oc for qemu-devel@nongnu.org; Wed, 01 Aug 2012 04:58:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwUlI-0002hj-NA for qemu-devel@nongnu.org; Wed, 01 Aug 2012 04:58:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6503) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwUlI-0002he-FY; Wed, 01 Aug 2012 04:58:36 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q718wZuP009537 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 1 Aug 2012 04:58:35 -0400 Received: from dhcp-8-167.nay.redhat.com ([10.66.7.126]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q718wSqC027838; Wed, 1 Aug 2012 04:58:33 -0400 From: Amos Kong To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Wed, 1 Aug 2012 16:59:01 +0800 Message-Id: <1343811543-12137-2-git-send-email-akong@redhat.com> In-Reply-To: <1343811543-12137-1-git-send-email-akong@redhat.com> References: <1343811543-12137-1-git-send-email-akong@redhat.com> In-Reply-To: <1342539951-30915-1-git-send-email-akong@redhat.com> References: <1342539951-30915-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, Amos Kong , quintela@redhat.com Subject: [Qemu-devel] [RESEND PATCH 1/3] socket: remove redundant check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org It's aleady in the end of loop, error should be set. Signed-off-by: Amos Kong --- qemu-sockets.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/qemu-sockets.c b/qemu-sockets.c index 668fa93..c636882 100644 --- a/qemu-sockets.c +++ b/qemu-sockets.c @@ -181,9 +181,7 @@ int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp) fprintf(stderr,"%s: bind(%s,%s,%d): %s\n", __FUNCTION__, inet_strfamily(e->ai_family), uaddr, inet_getport(e), strerror(errno)); - if (!e->ai_next) { - error_set(errp, QERR_SOCKET_BIND_FAILED); - } + error_set(errp, QERR_SOCKET_BIND_FAILED); } } closesocket(slisten);