From patchwork Tue Jul 19 02:38:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 649894 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rtkml12nsz9sBM for ; Tue, 19 Jul 2016 12:40:39 +1000 (AEST) Received: from localhost ([::1]:51530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPKxY-0001Hb-NT for incoming@patchwork.ozlabs.org; Mon, 18 Jul 2016 22:40:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPKw8-00004y-3Z for qemu-devel@nongnu.org; Mon, 18 Jul 2016 22:39:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPKw6-0007VH-0W for qemu-devel@nongnu.org; Mon, 18 Jul 2016 22:39:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPKw5-0007VD-R3 for qemu-devel@nongnu.org; Mon, 18 Jul 2016 22:39:05 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6EDE011BB4D; Tue, 19 Jul 2016 02:39:05 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (vpn1-6-66.pek2.redhat.com [10.72.6.66]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6J2cuq8030481; Mon, 18 Jul 2016 22:39:03 -0400 From: Jason Wang To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Tue, 19 Jul 2016 10:38:51 +0800 Message-Id: <1468895935-23097-3-git-send-email-jasowang@redhat.com> In-Reply-To: <1468895935-23097-1-git-send-email-jasowang@redhat.com> References: <1468895935-23097-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Jul 2016 02:39:05 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL V2 2/6] net: fix incorrect access to pointer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Jason Wang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini This is not dereferencing the pointer, and instead checking only the value of the pointer. Signed-off-by: Paolo Bonzini Signed-off-by: Jason Wang --- 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);