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 From: Yik Fang Date: Thu, 12 Feb 2015 06:21:51 +0000 Message-ID: <1423722111-12902-1-git-send-email-eric.fangyi@huawei.com> MIME-Version: 1.0 Content-Type: text/plain 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, Yik Fang , boby.chen@huawei.com, rudy.zhangmin@huawei.com, wu.wubin@huawei.com 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