Re: [PATCH net V2] vhost: correctly check the return value of translate_desc() in log_used()

2019-02-19 Thread David Miller
From: Jason Wang Date: Tue, 19 Feb 2019 14:53:44 +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. > > Detected by CoverityScan, CID# 1442593: Control flow

Re: [PATCH][next] vhost: only return early if ret indicates an error or no iovecs have been processed

2019-02-19 Thread Colin Ian King
On 19/02/2019 16:35, Michael S. Tsirkin wrote: > On Tue, Feb 19, 2019 at 01:57:13PM +, Colin King wrote: >> From: Colin Ian King >> >> Currently the loop that calls log_write_hva on each iovec is never >> executed because of an incorrect error check on the return from the >> call to

Re: [PATCH][next] vhost: only return early if ret indicates an error or no iovecs have been processed

2019-02-19 Thread Michael S. Tsirkin
On Tue, Feb 19, 2019 at 01:57:13PM +, Colin King wrote: > From: Colin Ian King > > Currently the loop that calls log_write_hva on each iovec is never > executed because of an incorrect error check on the return from the > call to translate_desc. The check should be checking for a -ve error

[PATCH][next] vhost: only return early if ret indicates an error or no iovecs have been processed

2019-02-19 Thread Colin King
From: Colin Ian King Currently the loop that calls log_write_hva on each iovec is never executed because of an incorrect error check on the return from the call to translate_desc. The check should be checking for a -ve error return and because it makes no sense to iterate over zero items, the