From patchwork Wed Dec 10 10:34:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 419577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 163961400DE for ; Wed, 10 Dec 2014 22:06:23 +1100 (AEDT) Received: from localhost ([::1]:44723 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xyf64-0002iu-SJ for incoming@patchwork.ozlabs.org; Wed, 10 Dec 2014 06:06:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyecW-0000sV-I6 for qemu-devel@nongnu.org; Wed, 10 Dec 2014 05:35:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyecR-0008Od-7A for qemu-devel@nongnu.org; Wed, 10 Dec 2014 05:35:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyecQ-0008OV-UK for qemu-devel@nongnu.org; Wed, 10 Dec 2014 05:35:43 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBAAZgiu028805 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 10 Dec 2014 05:35:42 -0500 Received: from noname.str.redhat.com (dhcp-192-197.str.redhat.com [10.33.192.197]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBAAYeSi016328; Wed, 10 Dec 2014 05:35:41 -0500 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Wed, 10 Dec 2014 11:34:29 +0100 Message-Id: <1418207679-32260-64-git-send-email-kwolf@redhat.com> In-Reply-To: <1418207679-32260-1-git-send-email-kwolf@redhat.com> References: <1418207679-32260-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com Subject: [Qemu-devel] [PULL 63/73] block/raw-posix: Fix ret in raw_open_common() 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 From: Max Reitz The return value must be negative on error; there is one place in raw_open_common() where errp is set, but ret remains 0. Fix it. Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/raw-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index 2e6a919..e51293a 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -446,6 +446,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, } if (fstat(s->fd, &st) < 0) { + ret = -errno; error_setg_errno(errp, errno, "Could not stat file"); goto fail; }