CHROMIUM: virtwl: properly free qentries that are empty

If a qentry was received from the device empty, and an ioctl recv is
performed on the qentry, the vfd_qentry_free_if_empty call would be
skipped over. Because the qentry is still part of the vfd, the ioctl
recv would assume there is more data to read and repeat the entire
proces, causing a hang.

The solution in this change is to always call vfd_qentry_free_if_empty
even if the entry is empty so that the entry gets removed from the vfd
and the ioctl recv can return or enter a wait queue.

BUG=chromium:791724
TEST=test code from BUG

Change-Id: Ifb744dff6a56ac104b9f0816dee680461824daba
Signed-off-by: Zach Reizner <zachr@google.com>
Reviewed-on: https://chromium-review.googlesource.com/974894
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
1 file changed