From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 8FF701B131 for ; Wed, 28 Nov 2018 17:21:02 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id c14so21276714wrr.0 for ; Wed, 28 Nov 2018 08:21:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OyQoyFMtHPcAQLbqcnE8AAsEhaI/Sjyg0c68qIiGrzw=; b=d8lcpS+2UNYhq+EMWzW5iKZH8cKd2bovXBYcAFD56uzr/NmT01MGdSRNXa96sMQk8Z IqVSUbqv8tfrzFHEBcxAArG+CAr1HPUoszCkcPKxvwcWD657GzCsKAH4qLYoNNY215es ZsmQVMScivkcH6zOcgREW4H1mC+aff7CkbV8vI3Kd6H8eWF39itQfVNJ6RhRKziG9Wwz FQO7zsmz/wotsP6DWJ10uuoDedr28ozNwzVKjmcSgcrkpvUEHsteEinUBu7SDhSsdMUJ X2ZUDovd7FSF469wA1+Evba2UgkzIzhu9LYxtvGAO68bsEVMvjj79PC4gdTHyZCjV+FA mCcg== X-Gm-Message-State: AA+aEWadznaoOJoGMLktT/JEnXh7uzz5AzL0SuPNlB4kgWEWV82+CkT8 QbpjPQdFyWc6l7ijsZ+A3XtYuGII X-Google-Smtp-Source: AFSGD/VIiYRtZrGtt3KuP7Q9/lBDpFfLUr1WuYGDLoji/gRC91O9alld1JIAf2nm3HeVLhern2fkCg== X-Received: by 2002:adf:fc51:: with SMTP id e17mr27366739wrs.268.1543422061825; Wed, 28 Nov 2018 08:21:01 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id j8sm5870176wrt.40.2018.11.28.08.21.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Nov 2018 08:21:00 -0800 (PST) From: Luca Boccassi To: stable@dpdk.org Cc: i.maximets@samsung.com, maxime.coquelin@redhat.com Date: Wed, 28 Nov 2018 16:20:54 +0000 Message-Id: <20181128162054.8182-1-bluca@debian.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 16.11] vhost-user: fix false negative in handling user messages X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2018 16:21:02 -0000 vhost_user_msg_handler checks an accumulated return code before returning, and prints an error and returns -1 if it's non-zero. But some of the possible user messages cannot fail and thus do not set the variable, which might retain a previously set and unrelated value, causing unnecessary failures and error messages. Reset the return code before use. Fixes: 0ce9e73d1e8d ("vhost-user: drop connection on message handling failures") Signed-off-by: Luca Boccassi --- Found this issue when testing with the Vyatta stuff, "ret" is set at the beginning of the function and never reset when the message is for example VHOST_USER_GET_FEATURES so there's a flurry of errors. lib/librte_vhost/vhost_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 00872c868..618d413fe 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1087,6 +1087,7 @@ vhost_user_msg_handler(int vid, int fd) } + ret = 0; switch (msg.request) { case VHOST_USER_GET_FEATURES: msg.payload.u64 = vhost_user_get_features(); -- 2.19.2