diff mbox

[PULL,V2,2/6] net: fix incorrect access to pointer

Message ID 1468895935-23097-3-git-send-email-jasowang@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jason Wang July 19, 2016, 2:38 a.m. UTC
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 mbox

Patch

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);