From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] vhost: correctly check the return value of translate_desc() in log_used() Date: Fri, 15 Feb 2019 10:03:56 -0800 (PST) Message-ID: <20190215.100356.251698752340585300.davem__7430.92044010467$1550253850$gmane$org@davemloft.net> References: <20190215075324.18891-1-jasowang@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190215075324.18891-1-jasowang@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: jasowang@redhat.com Cc: kvm@vger.kernel.org, mst@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org List-Id: virtualization@lists.linuxfoundation.org From: Jason Wang Date: Fri, 15 Feb 2019 15:53:24 +0800 > When fail, translate_desc() returns negative value, otherwise the > number of iovs. So we should fail when the return value is negative > instead of a blindly check against zero. > > Reported-by: Stephen Hemminger > Fixes: cc5e71075947 ("vhost: log dirty page correctly") > Signed-off-by: Jason Wang Jason, please put the Fixes tag first. Thank you.