Skip to contentSkip to conversation

net: fix incorrect access to pointer

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: fix incorrect access to pointer

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

---
 net/eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/eth.c +1 -1
index 0be59c2..df81efb 100644
@@ -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);
 
Signature · 1 line
2.7.4
Applied
#1 lore raw
Quoted 13 lines · Paolo Bonzini

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

---
  net/eth.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
net/eth.c +0 -0
index 0be59c2..df81efb 100644

net/eth.c void eth_get_protocols(const struct iovec *iov, int iovcnt, · line 217

Quoted 8 lines
net/eth.c +1 -1
@@ -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);
 

Applied to -net. Thanks