From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSF7X-0006iC-1N for qemu-devel@nongnu.org; Sun, 01 Mar 2015 20:26:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSF7T-0007by-QL for qemu-devel@nongnu.org; Sun, 01 Mar 2015 20:26:06 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:35930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSF7T-0007Su-6j for qemu-devel@nongnu.org; Sun, 01 Mar 2015 20:26:03 -0500 Message-ID: <54F3BC0A.4010209@huawei.com> Date: Mon, 2 Mar 2015 09:25:30 +0800 From: "Fangyi (C)" MIME-Version: 1.0 References: <1423722111-12902-1-git-send-email-eric.fangyi@huawei.com> In-Reply-To: <1423722111-12902-1-git-send-email-eric.fangyi@huawei.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] nbd: Fix overflow return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Cc: famz@redhat.com, stefanha@redhat.com, kathy.wangting@huawei.com, boby.chen@huawei.com, rudy.zhangmin@huawei.com, wu.wubin@huawei.com PING The value of reply.error should be the type unsigned int. Signed-off-by: Yik Fang --- 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; -- 1.8.5