Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 347a5293 authored by Minfei Huang's avatar Minfei Huang Committed by Michael S. Tsirkin
Browse files

virtio_blk: Fix a slient kernel panic



We do a lot of memory allocation in function init_vq, and don't handle
the allocation failure properly. Then this function will return 0,
although initialization fails due to lacking memory. At that moment,
kernel will panic in guest machine, if virtio is used to drive disk.

To fix this bug, we should take care of allocation failure, and return
correct value to let caller know what happen.

Tested-by: default avatarChao Fan <fanc.fnst@cn.fujitsu.com>
Signed-off-by: default avatarMinfei Huang <mnghuan@gmail.com>
Signed-off-by: default avatarMinfei Huang <minfei.hmf@alibaba-inc.com>
Reviewed-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 28ad5557
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment