Skip to contentSkip to conversation

e1000e: fix incorrect access to pointer

PATCH Applied Paolo Bonzini 2 participants 2 messages Jul 15, 2016 – Jul 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e1000e: fix incorrect access to pointer

This is not dereferencing the pointer, and instead checking only the value of the pointer.

---
 hw/net/e1000e_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/net/e1000e_core.c +2 -2
index 6050d8b..badb1fe 100644
@@ -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;
     }
 
Signature · 1 line
2.7.4
Applied
#1 lore raw
Quoted 22 lines · Paolo Bonzini

This is not dereferencing the pointer, and instead checking only the value of the pointer.

---
  hw/net/e1000e_core.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
hw/net/e1000e_core.c +1 -1
index 6050d8b..badb1fe 100644
@@ -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;
      }
 

hw/net/e1000e_core.c e1000e_intrmgr_delay_tx_causes(E1000ECore *core, uint32_t *causes) · line 328

Quoted 8 lines
hw/net/e1000e_core.c +1 -1
@@ -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;
      }
 

Applied to -net. Thanks