* [Qemu-devel] [PULL V2 1/6] e1000e: fix incorrect access to pointer
2016-07-19 2:38 [Qemu-devel] [PULL V2 0/6] Net patches Jason Wang
@ 2016-07-19 2:38 ` Jason Wang
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 2/6] net: " Jason Wang
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jason Wang @ 2016-07-19 2:38 UTC (permalink / raw)
To: peter.maydell, qemu-devel; +Cc: Paolo Bonzini, Jason Wang
From: Paolo Bonzini <pbonzini@redhat.com>
This is not dereferencing the pointer, and instead checking only
the value of the pointer.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/e1000e_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index 6050d8b..badb1fe 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -281,7 +281,7 @@ e1000e_intrmgr_delay_rx_causes(E1000ECore *core, uint32_t *causes)
/* Check if delayed RX interrupts disabled by client
or if there are causes that cannot be delayed */
- if ((rdtr == 0) || (causes != 0)) {
+ if ((rdtr == 0) || (*causes != 0)) {
return false;
}
@@ -322,7 +322,7 @@ e1000e_intrmgr_delay_tx_causes(E1000ECore *core, uint32_t *causes)
*causes &= ~delayable_causes;
/* If there are causes that cannot be delayed */
- if (causes != 0) {
+ if (*causes != 0) {
return false;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL V2 2/6] net: fix incorrect access to pointer
2016-07-19 2:38 [Qemu-devel] [PULL V2 0/6] Net patches Jason Wang
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 1/6] e1000e: fix incorrect access to pointer Jason Wang
@ 2016-07-19 2:38 ` Jason Wang
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 3/6] net: fix incorrect argument to iov_to_buf Jason Wang
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jason Wang @ 2016-07-19 2:38 UTC (permalink / raw)
To: peter.maydell, qemu-devel; +Cc: Paolo Bonzini, Jason Wang
From: Paolo Bonzini <pbonzini@redhat.com>
This is not dereferencing the pointer, and instead checking only
the value of the pointer.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/eth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/eth.c b/net/eth.c
index 95fe15c..c147c2e 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -211,7 +211,7 @@ void eth_get_protocols(const struct iovec *iov, int iovcnt,
*l4hdr_off, sizeof(l4hdr_info->hdr.tcp),
&l4hdr_info->hdr.tcp);
- if (istcp) {
+ if (*istcp) {
*l5hdr_off = *l4hdr_off +
TCP_HEADER_DATA_OFFSET(&l4hdr_info->hdr.tcp);
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL V2 3/6] net: fix incorrect argument to iov_to_buf
2016-07-19 2:38 [Qemu-devel] [PULL V2 0/6] Net patches Jason Wang
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 1/6] e1000e: fix incorrect access to pointer Jason Wang
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 2/6] net: " Jason Wang
@ 2016-07-19 2:38 ` Jason Wang
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 4/6] tap: fix memory leak on failure to create a multiqueue tap device Jason Wang
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jason Wang @ 2016-07-19 2:38 UTC (permalink / raw)
To: peter.maydell, qemu-devel; +Cc: Paolo Bonzini, Jason Wang
From: Paolo Bonzini <pbonzini@redhat.com>
Coverity reports a "suspicious sizeof" which is indeed wrong.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/eth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/eth.c b/net/eth.c
index c147c2e..df81efb 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -418,7 +418,7 @@ _eth_get_rss_ex_dst_addr(const struct iovec *pkt, int pkt_frags,
bytes_read = iov_to_buf(pkt, pkt_frags,
rthdr_offset + sizeof(*ext_hdr),
- dst_addr, sizeof(dst_addr));
+ dst_addr, sizeof(*dst_addr));
return bytes_read == sizeof(dst_addr);
}
@@ -467,7 +467,7 @@ _eth_get_rss_ex_src_addr(const struct iovec *pkt, int pkt_frags,
bytes_read = iov_to_buf(pkt, pkt_frags,
opt_offset + sizeof(opthdr),
- src_addr, sizeof(src_addr));
+ src_addr, sizeof(*src_addr));
return bytes_read == sizeof(src_addr);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL V2 4/6] tap: fix memory leak on failure to create a multiqueue tap device
2016-07-19 2:38 [Qemu-devel] [PULL V2 0/6] Net patches Jason Wang
` (2 preceding siblings ...)
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 3/6] net: fix incorrect argument to iov_to_buf Jason Wang
@ 2016-07-19 2:38 ` Jason Wang
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 5/6] MAINTAINERS: release Scott from being a rocker maintainer Jason Wang
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Jason Wang @ 2016-07-19 2:38 UTC (permalink / raw)
To: peter.maydell, qemu-devel; +Cc: Paolo Bonzini, Jason Wang
From: Paolo Bonzini <pbonzini@redhat.com>
Reported by Coverity.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/tap.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/net/tap.c b/net/tap.c
index e9c32f3..6a2cedc 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -787,8 +787,8 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
return -1;
}
} else if (tap->has_fds) {
- char **fds = g_new(char *, MAX_TAP_QUEUES);
- char **vhost_fds = g_new(char *, MAX_TAP_QUEUES);
+ char **fds = g_new0(char *, MAX_TAP_QUEUES);
+ char **vhost_fds = g_new0(char *, MAX_TAP_QUEUES);
int nfds, nvhosts;
if (tap->has_ifname || tap->has_script || tap->has_downscript ||
@@ -806,7 +806,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
if (nfds != nvhosts) {
error_setg(errp, "The number of fds passed does not match "
"the number of vhostfds passed");
- return -1;
+ goto free_fail;
}
}
@@ -814,7 +814,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
fd = monitor_fd_param(cur_mon, fds[i], &err);
if (fd == -1) {
error_propagate(errp, err);
- return -1;
+ goto free_fail;
}
fcntl(fd, F_SETFL, O_NONBLOCK);
@@ -824,7 +824,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
} else if (vnet_hdr != tap_probe_vnet_hdr(fd)) {
error_setg(errp,
"vnet_hdr not consistent across given tap fds");
- return -1;
+ goto free_fail;
}
net_init_tap_one(tap, peer, "tap", name, ifname,
@@ -833,11 +833,21 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
vnet_hdr, fd, &err);
if (err) {
error_propagate(errp, err);
- return -1;
+ goto free_fail;
}
}
g_free(fds);
g_free(vhost_fds);
+ return 0;
+
+free_fail:
+ for (i = 0; i < nfds; i++) {
+ g_free(fds[i]);
+ g_free(vhost_fds[i]);
+ }
+ g_free(fds);
+ g_free(vhost_fds);
+ return -1;
} else if (tap->has_helper) {
if (tap->has_ifname || tap->has_script || tap->has_downscript ||
tap->has_vnet_hdr || tap->has_queues || tap->has_vhostfds) {
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL V2 5/6] MAINTAINERS: release Scott from being a rocker maintainer
2016-07-19 2:38 [Qemu-devel] [PULL V2 0/6] Net patches Jason Wang
` (3 preceding siblings ...)
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 4/6] tap: fix memory leak on failure to create a multiqueue tap device Jason Wang
@ 2016-07-19 2:38 ` Jason Wang
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 6/6] e1000e: fix building without CONFIG_VMXNET3_PCI Jason Wang
2016-07-19 12:41 ` [Qemu-devel] [PULL V2 0/6] Net patches Peter Maydell
6 siblings, 0 replies; 8+ messages in thread
From: Jason Wang @ 2016-07-19 2:38 UTC (permalink / raw)
To: peter.maydell, qemu-devel; +Cc: Jiri Pirko, Scott Feldman, Jason Wang
From: Jiri Pirko <jiri@mellanox.com>
As requested by Scott, removing him.
Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
MAINTAINERS | 1 -
1 file changed, 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 1d0e2c3..5928f22 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -971,7 +971,6 @@ F: hw/net/vmxnet*
F: hw/scsi/vmw_pvscsi*
Rocker
-M: Scott Feldman <sfeldma@gmail.com>
M: Jiri Pirko <jiri@resnulli.us>
S: Maintained
F: hw/net/rocker/
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL V2 6/6] e1000e: fix building without CONFIG_VMXNET3_PCI
2016-07-19 2:38 [Qemu-devel] [PULL V2 0/6] Net patches Jason Wang
` (4 preceding siblings ...)
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 5/6] MAINTAINERS: release Scott from being a rocker maintainer Jason Wang
@ 2016-07-19 2:38 ` Jason Wang
2016-07-19 12:41 ` [Qemu-devel] [PULL V2 0/6] Net patches Peter Maydell
6 siblings, 0 replies; 8+ messages in thread
From: Jason Wang @ 2016-07-19 2:38 UTC (permalink / raw)
To: peter.maydell, qemu-devel; +Cc: Jason Wang, Dmitry Fleytman, Leonid Bloch
e1000e needs net_tx_pkt.o and net_rx_pkt.o too.
Cc: Dmitry Fleytman <dmitry.fleytman@ravellosystems.com>
Cc: Leonid Bloch <leonid.bloch@ravellosystems.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/Makefile.objs | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/Makefile.objs b/hw/net/Makefile.objs
index fe61e9f..610ed3e 100644
--- a/hw/net/Makefile.objs
+++ b/hw/net/Makefile.objs
@@ -7,6 +7,7 @@ common-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o
common-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o
common-obj-$(CONFIG_PCNET_COMMON) += pcnet.o
common-obj-$(CONFIG_E1000_PCI) += e1000.o e1000x_common.o
+common-obj-$(CONFIG_E1000E_PCI) += net_tx_pkt.o net_rx_pkt.o
common-obj-$(CONFIG_E1000E_PCI) += e1000e.o e1000e_core.o e1000x_common.o
common-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o
common-obj-$(CONFIG_VMXNET3_PCI) += net_tx_pkt.o net_rx_pkt.o
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PULL V2 0/6] Net patches
2016-07-19 2:38 [Qemu-devel] [PULL V2 0/6] Net patches Jason Wang
` (5 preceding siblings ...)
2016-07-19 2:38 ` [Qemu-devel] [PULL V2 6/6] e1000e: fix building without CONFIG_VMXNET3_PCI Jason Wang
@ 2016-07-19 12:41 ` Peter Maydell
6 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2016-07-19 12:41 UTC (permalink / raw)
To: Jason Wang; +Cc: QEMU Developers
On 19 July 2016 at 03:38, Jason Wang <jasowang@redhat.com> wrote:
> The following changes since commit 6b92bbfe812746fe7841a24c24e6460f5359ce72:
>
> Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging (2016-07-15 16:56:08 +0100)
>
> are available in the git repository at:
>
> https://github.com/jasowang/qemu.git tags/net-pull-request
>
> for you to fetch changes up to 103916cbe923f08080717942f1b5f9c4eb74aa11:
>
> e1000e: fix building without CONFIG_VMXNET3_PCI (2016-07-18 16:17:02 +0800)
>
> ----------------------------------------------------------------
> Changes from V1:
> - no changes, V1 just misses the list.
>
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread