diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-08-04 10:20:08 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-08-04 10:20:08 +0100 |
commit | bcc983234ba0852729107acca3365ab5359dc0e0 (patch) | |
tree | 53675dd7702cd9c4c878d429f3e3c9e6544a7574 | |
parent | 5c1c3e4f02e458cf280c677c817ae4fd1ed9bf10 (diff) | |
parent | 035e69b063835a5fd23cacabd63690a3d84532a8 (diff) |
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
# gpg: Signature made Tue 04 Aug 2020 07:15:08 BST
# gpg: using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg: It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211
* remotes/jasowang/tags/net-pull-request:
hw/net/net_tx_pkt: fix assertion failure in net_tx_pkt_add_raw_fragment()
colo-compare: Remove superfluous NULL-pointer checks for s->iothread
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | hw/net/net_tx_pkt.c | 5 | ||||
-rw-r--r-- | net/colo-compare.c | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index 9560e4a49e..da262edc3e 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -379,7 +379,10 @@ bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa, hwaddr mapped_len = 0; struct iovec *ventry; assert(pkt); - assert(pkt->max_raw_frags > pkt->raw_frags); + + if (pkt->raw_frags >= pkt->max_raw_frags) { + return false; + } if (!len) { return true; diff --git a/net/colo-compare.c b/net/colo-compare.c index cc15f23dea..2c20de1537 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1442,9 +1442,7 @@ static void colo_compare_finalize(Object *obj) qemu_chr_fe_deinit(&s->chr_notify_dev, false); } - if (s->iothread) { - colo_compare_timer_del(s); - } + colo_compare_timer_del(s); qemu_bh_delete(s->event_bh); @@ -1470,9 +1468,7 @@ static void colo_compare_finalize(Object *obj) g_hash_table_destroy(s->connection_track_table); } - if (s->iothread) { - object_unref(OBJECT(s->iothread)); - } + object_unref(OBJECT(s->iothread)); g_free(s->pri_indev); g_free(s->sec_indev); |