All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Qiang <liq3ea@gmail.com>
To: Li Qiang <liq3ea@163.com>
Cc: Alexander Bulekov <alxndr@bu.edu>, John Snow <jsnow@redhat.com>,
	Qemu Developers <qemu-devel@nongnu.org>,
	qemu-block@nongnu.org
Subject: Re: [PATCH] hw: ide: check the pointer before do dma memory unmap
Date: Mon, 7 Sep 2020 09:39:42 +0800	[thread overview]
Message-ID: <CAKXe6S+Qq+GN6JYJa69+s0UHUd=2EKRAwJAjUKVt3+jPqdWeCQ@mail.gmail.com> (raw)
In-Reply-To: <CAKXe6SJkqaeDBpDC__N6-RYgOMdTRO8NcJ0jkaFvAheEkfqbbw@mail.gmail.com>

Ping!

Li Qiang <liq3ea@gmail.com> 于2020年9月1日周二 下午6:34写道:
>
> Ping.
>
> Li Qiang <liq3ea@163.com> 于2020年8月15日周六 下午3:21写道:
> >
> > In 'map_page' we need to check the return value of
> > 'dma_memory_map' to ensure the we actully maped something.
> > Otherwise, we will hit an assert in 'address_space_unmap'.
> > This is because we can't find the MR with the NULL buffer.
> > This is the LP#1884693:
> >
> > -->https://bugs.launchpad.net/qemu/+bug/1884693
> >
> > Reported-by: Alexander Bulekov <alxndr@bu.edu>
> > Signed-off-by: Li Qiang <liq3ea@163.com>
> > ---
> >  hw/ide/ahci.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
> > index 009120f88b..63e9fccdbe 100644
> > --- a/hw/ide/ahci.c
> > +++ b/hw/ide/ahci.c
> > @@ -250,6 +250,11 @@ static void map_page(AddressSpace *as, uint8_t **ptr, uint64_t addr,
> >      }
> >
> >      *ptr = dma_memory_map(as, addr, &len, DMA_DIRECTION_FROM_DEVICE);
> > +
> > +    if (!*ptr) {
> > +        return;
> > +    }
> > +
> >      if (len < wanted) {
> >          dma_memory_unmap(as, *ptr, len, DMA_DIRECTION_FROM_DEVICE, len);
> >          *ptr = NULL;
> > --
> > 2.17.1
> >


  reply	other threads:[~2020-09-07  1:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15  7:20 [PATCH] hw: ide: check the pointer before do dma memory unmap Li Qiang
2020-09-01 10:34 ` Li Qiang
2020-09-07  1:39   ` Li Qiang [this message]
2020-09-15 13:38     ` Li Qiang
2020-09-22  1:17       ` Li Qiang
2020-09-22  1:34 ` Alexander Bulekov
2020-09-22  8:18   ` Philippe Mathieu-Daudé
2020-09-22 10:37     ` Li Qiang
2020-09-22 10:46       ` Philippe Mathieu-Daudé
2020-09-22 12:11         ` Li Qiang

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='CAKXe6S+Qq+GN6JYJa69+s0UHUd=2EKRAwJAjUKVt3+jPqdWeCQ@mail.gmail.com' \
    --to=liq3ea@gmail.com \
    --cc=alxndr@bu.edu \
    --cc=jsnow@redhat.com \
    --cc=liq3ea@163.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.