From: Jason Wang <jasowang@redhat.com>
To: peter.maydell@linaro.org, stefanha@redhat.com, qemu-devel@nongnu.org
Cc: Prasad J Pandit <pjp@fedoraproject.org>,
Jason Wang <jasowang@redhat.com>
Subject: [Qemu-devel] [PULL 1/3] net: mcf: check receive buffer size register value
Date: Mon, 5 Dec 2016 17:52:01 +0800 [thread overview]
Message-ID: <1480931523-5769-2-git-send-email-jasowang@redhat.com> (raw)
In-Reply-To: <1480931523-5769-1-git-send-email-jasowang@redhat.com>
From: Prasad J Pandit <pjp@fedoraproject.org>
ColdFire Fast Ethernet Controller uses a receive buffer size
register(EMRBR) to hold maximum size of all receive buffers.
It is set by a user before any operation. If it was set to be
zero, ColdFire emulator would go into an infinite loop while
receiving data in mcf_fec_receive. Add check to avoid it.
Reported-by: Wjjzhang <wjjzhang@tencent.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/mcf_fec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/net/mcf_fec.c b/hw/net/mcf_fec.c
index dc61bac..4025eb3 100644
--- a/hw/net/mcf_fec.c
+++ b/hw/net/mcf_fec.c
@@ -393,7 +393,7 @@ static void mcf_fec_write(void *opaque, hwaddr addr,
s->tx_descriptor = s->etdsr;
break;
case 0x188:
- s->emrbr = value & 0x7f0;
+ s->emrbr = value > 0 ? value & 0x7F0 : 0x7F0;
break;
default:
hw_error("mcf_fec_write Bad address 0x%x\n", (int)addr);
--
2.7.4
next prev parent reply other threads:[~2016-12-05 9:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 9:52 [Qemu-devel] [PULL 0/3] Net patches Jason Wang
2016-12-05 9:52 ` Jason Wang [this message]
2016-12-05 9:52 ` [Qemu-devel] [PULL 2/3] fsl_etsec: Pad short payloads with zeros Jason Wang
2016-12-05 9:52 ` [Qemu-devel] [PULL 3/3] fsl_etsec: Fix various small problems in hexdump code Jason Wang
2016-12-05 10:42 ` [Qemu-devel] [PULL 0/3] Net patches no-reply
2016-12-05 14:35 ` Stefan Hajnoczi
2016-12-06 2:32 ` Jason Wang
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=1480931523-5769-2-git-send-email-jasowang@redhat.com \
--to=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pjp@fedoraproject.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).