From patchwork Thu Feb 12 06:21:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yik Fang X-Patchwork-Id: 439105 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 A429014017B for ; Thu, 12 Feb 2015 18:29:36 +1100 (AEDT) Received: from localhost ([::1]:48851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLoDO-0005KS-PV for incoming@patchwork.ozlabs.org; Thu, 12 Feb 2015 02:29:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLo2f-0007vy-8G for qemu-devel@nongnu.org; Thu, 12 Feb 2015 02:18:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLo2c-00006T-24 for qemu-devel@nongnu.org; Thu, 12 Feb 2015 02:18:29 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:37744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLo2b-00005v-DG for qemu-devel@nongnu.org; Thu, 12 Feb 2015 02:18:25 -0500 Received: from 172.24.2.119 (EHLO szxeml430-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BBV52068; Thu, 12 Feb 2015 15:18:10 +0800 (CST) Received: from localhost (10.175.101.253) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.158.1; Thu, 12 Feb 2015 15:17:44 +0800 From: Yik Fang To: Date: Thu, 12 Feb 2015 06:21:51 +0000 Message-ID: <1423722111-12902-1-git-send-email-eric.fangyi@huawei.com> X-Mailer: git-send-email 1.8.5 MIME-Version: 1.0 X-Originating-IP: [10.175.101.253] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.54DC53B3.01D8, ss=1, re=0.001, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 034bc57631a16f437648571e33f7c1d3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.66 X-Mailman-Approved-At: Thu, 12 Feb 2015 02:29:03 -0500 Cc: famz@redhat.com, stefanha@redhat.com, kathy.wangting@huawei.com, Yik Fang , boby.chen@huawei.com, rudy.zhangmin@huawei.com, wu.wubin@huawei.com Subject: [Qemu-devel] [PATCH] nbd: Fix overflow return value 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 The value of reply.error should be the type unsigned int. Signed-off-by: Yik Fang Reviewed-by: Fam Zheng --- nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbd.c b/nbd.c index e56afbc1..30e2f3b 100644 --- a/nbd.c +++ b/nbd.c @@ -1295,7 +1295,7 @@ static void nbd_trip(void *opaque) default: LOG("invalid request type (%u) received", request.type); invalid_request: - reply.error = -EINVAL; + reply.error = EINVAL; error_reply: if (nbd_co_send_reply(req, &reply, 0) < 0) { goto out;