Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1446384

Re: [PATCH v3] virtio_blk: Fix a slient kernel panic

From Cornelia Huck <cornelia.huck@de.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3] virtio_blk: Fix a slient kernel panic
Date 2016-07-19 14:30 +0200
Message-ID <rWCjU-3Wt-23@gated-at.bofh.it> (permalink)
References <rWuZ3-7HB-3@gated-at.bofh.it>
Organization IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Show all headers | View raw


On Tue, 19 Jul 2016 12:32:42 +0800
Minfei Huang <mnfhuang@gmail.com> wrote:

> From: Minfei Huang <mnghuan@gmail.com>
> 
> 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: Chao Fan <fanc.fnst@cn.fujitsu.com>
> Signed-off-by: Minfei Huang <minfei.hmf@alibaba-inc.com>
> Signed-off-by: Minfei Huang <mnghuan@gmail.com>
> ---
> v2:
> - Remove useless initialisation to NULL
> v1:
> - Refactor the patch to make code more readable
> ---
>  drivers/block/virtio_blk.c | 26 ++++++++------------------
>  1 file changed, 8 insertions(+), 18 deletions(-)

Your changes certainly make the function more compact.

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3] virtio_blk: Fix a slient kernel panic Minfei Huang <mnfhuang@gmail.com> - 2016-07-19 06:40 +0200
  Re: [PATCH v3] virtio_blk: Fix a slient kernel panic Cornelia Huck <cornelia.huck@de.ibm.com> - 2016-07-19 14:30 +0200
    Re: [PATCH v3] virtio_blk: Fix a slient kernel panic Minfei Huang <minfei.hmf@alibaba-inc.com> - 2016-07-23 04:10 +0200

csiph-web