From: Blue Swirl <blauwirbel@gmail.com>
To: "Igor V. Kovalenko" <igor.v.kovalenko@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] workaround for cmd646 bmdma register access while no dma is active
Date: Sun, 13 Dec 2009 15:50:52 +0000 [thread overview]
Message-ID: <f43fc5580912130750r769da6c1r8bccc1948d28d00b@mail.gmail.com> (raw)
In-Reply-To: <20091213122358.10712.96713.stgit@skyserv>
On Sun, Dec 13, 2009 at 12:23 PM, Igor V. Kovalenko
<igor.v.kovalenko@gmail.com> wrote:
> From: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
>
> This is a workaround only, and is a partial revert
> of a few changes to BMDMAState which removed pci_dev
> field on the way.
>
> - cmd646 pci_from_bm() expects bm->unit value to
> correspond with bm data being passed to callback
> as opaque pointer. This breaks when write to dma
> control register of second channel happens when no
> dma operation is in progress, so bm->unit is zero
> for second channel, and pci_from_bm() returns garbage
> pointer. Crash happens shortly after that while
> dereferencing that pointer.
> static PCIIDEState *pci_from_bm(BMDMAState *bm)
> {
> + return bm->pci_dev;
> if (bm->unit == 0) {
> return container_of(bm, PCIIDEState, bmdma[0]);
> } else {
I think you should delete the rest of the function, unused code is
useless and if someone decides to fix and restore the old code, they
can fetch it from git.
next prev parent reply other threads:[~2009-12-13 15:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-13 12:23 [Qemu-devel] [PATCH] workaround for cmd646 bmdma register access while no dma is active Igor V. Kovalenko
2009-12-13 15:50 ` Blue Swirl [this message]
2009-12-13 18:00 ` Igor Kovalenko
-- strict thread matches above, loose matches on Subject: below --
2009-12-13 17:52 Igor V. Kovalenko
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=f43fc5580912130750r769da6c1r8bccc1948d28d00b@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=igor.v.kovalenko@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).