]> www.infradead.org Git - users/dwmw2/linux.git/commit
virtio-balloon: initialize all vq callbacks
authorDaniel Verkamp <dverkamp@chromium.org>
Fri, 3 Jan 2020 18:40:43 +0000 (10:40 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:37:15 +0000 (04:37 -0800)
commitab9377a8ca25a24648636dddba821b45a79b7d2b
tree30373d5787b3ca99f485cb70a8909d43f3c446c2
parent07a04e9faac72f0e329b2de5595a89dc481d77a6
virtio-balloon: initialize all vq callbacks

commit 5790b53390e18fdd21e70776e46d058c05eda2f2 upstream.

Ensure that elements of the callbacks array that correspond to
unavailable features are set to NULL; previously, they would be left
uninitialized.

Since the corresponding names array elements were explicitly set to
NULL, the uninitialized callback pointers would not actually be
dereferenced; however, the uninitialized callbacks elements would still
be read in vp_find_vqs_msix() and used to calculate the number of MSI-X
vectors required.

Cc: stable@vger.kernel.org
Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/virtio/virtio_balloon.c