Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
virtio_net: Fix error code in __virtnet_get_hw_stats()
The virtnet_send_command_reply() function returns true on success or false on failure. The "ok" variable is true/false depending on whether it succeeds or not. It's up to the caller to translate the true/false into -EINVAL on failure or zero for success. The bug is that __virtnet_get_hw_stats() returns false for both errors and success. It's not a bug, but it is confusing that the caller virtnet_get_hw_stats() uses an "ok" variable to store negative error codes. Fix the bug and clean things up so that it's clear that __virtnet_get_hw_stats() returns zero on success or negative error codes on failure. Fixes: 941168f ("virtio_net: support device stats") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Signed-off-by: NipaLocal <nipa@local>
- Loading branch information