From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Minfei Huang <mnfhuang@gmail.com>
Cc: mst@redhat.com, virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, fanc.fnst@cn.fujitsu.com,
Minfei Huang <mnghuan@gmail.com>,
Minfei Huang <minfei.hmf@alibaba-inc.com>
Subject: Re: [PATCH v3] virtio_blk: Fix a slient kernel panic
Date: Tue, 19 Jul 2016 14:22:43 +0200 [thread overview]
Message-ID: <20160719142243.1c62ac03.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1468902762-43268-1-git-send-email-mnfhuang@gmail.com>
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>
next prev parent reply other threads:[~2016-07-19 12:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-19 4:32 Minfei Huang
2016-07-19 12:22 ` Cornelia Huck [this message]
2016-07-23 1:58 ` Minfei Huang
2016-07-29 8:26 ` Stefan Hajnoczi
2016-08-04 5:35 ` Minfei Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160719142243.1c62ac03.cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=fanc.fnst@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=minfei.hmf@alibaba-inc.com \
--cc=mnfhuang@gmail.com \
--cc=mnghuan@gmail.com \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®