-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1 iQEcBAABAgAGBQJXtUlQAAoJEO8Ells5jWIRMF4H/1zLZluPiCl4JfSH6vXY20cz HU9efNm034qwnZXPd0716qIhwuz6VyXvRVMxeXVhEkh4srx3Z0H2MPPViPWQ4IWn WLnO/Bz3UrXV0rHWvgwEW5RlTTxdr2fWVwXDsxdCHOMIzcHJ1YVXfgMeAvIceQoc YvNNFRKORrlmbeHOVxS/p9CmhixXbmIryxNNWVXAm1BNJkkqu+FkOUgSvx6RowkM ww8SuX+dpbhHgv5HJVCp0D3C/QQthrZJkr6S4u8yreK8rrXb4ZMTKlg1GY9oRhfU nNThHOH/ql1tTSgPEDT8KbtXRJshADGygiVjElDfsDy/+acdIR5OgWPlVf52FU4= =21z1 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging # gpg: Signature made Thu 18 Aug 2016 06:36:16 BST # gpg: using RSA key 0xEF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # 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: net/net: properly handle multiple packets in net_fill_rstate() net: vmxnet: use g_new for pkt initialisation Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
5844365fe8
@ -65,10 +65,9 @@ void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev,
|
||||
|
||||
p->pci_dev = pci_dev;
|
||||
|
||||
p->vec = g_malloc((sizeof *p->vec) *
|
||||
(max_frags + NET_TX_PKT_PL_START_FRAG));
|
||||
p->vec = g_new(struct iovec, max_frags + NET_TX_PKT_PL_START_FRAG);
|
||||
|
||||
p->raw = g_malloc((sizeof *p->raw) * max_frags);
|
||||
p->raw = g_new(struct iovec, max_frags);
|
||||
|
||||
p->max_payload_frags = max_frags;
|
||||
p->max_raw_frags = max_frags;
|
||||
|
@ -1602,9 +1602,8 @@ void net_socket_rs_init(SocketReadState *rs,
|
||||
|
||||
/*
|
||||
* Returns
|
||||
* 0: SocketReadState is not ready
|
||||
* 1: SocketReadState is ready
|
||||
* otherwise error occurs
|
||||
* 0: success
|
||||
* -1: error occurs
|
||||
*/
|
||||
int net_fill_rstate(SocketReadState *rs, const uint8_t *buf, int size)
|
||||
{
|
||||
@ -1652,10 +1651,11 @@ int net_fill_rstate(SocketReadState *rs, const uint8_t *buf, int size)
|
||||
if (rs->finalize) {
|
||||
rs->finalize(rs);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assert(size == 0);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user