mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 14:44:12 +00:00
virtio_ring: mark ring unused on error
commit1861ba626a
upstream. A recently added error path does not mark ring unused when exiting on OOM, which will lead to BUG on the next entry in debug builds. TODO: refactor code so we have START_USE and END_USE in the same function. Fixes:fc6d70f40b
("virtio_ring: check desc == NULL when using indirect with packed") Cc: "Xuan Zhuo" <xuanzhuo@linux.alibaba.com> Cc: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0d3334c47a
commit
be82a92c46
1 changed files with 3 additions and 1 deletions
|
@ -1197,8 +1197,10 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
|
|||
if (virtqueue_use_indirect(_vq, total_sg)) {
|
||||
err = virtqueue_add_indirect_packed(vq, sgs, total_sg, out_sgs,
|
||||
in_sgs, data, gfp);
|
||||
if (err != -ENOMEM)
|
||||
if (err != -ENOMEM) {
|
||||
END_USE(vq);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* fall back on direct */
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue