From patchwork Wed Jan 27 17:44:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 60635 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2728993lbb; Wed, 27 Jan 2016 09:44:55 -0800 (PST) X-Received: by 10.107.3.88 with SMTP id 85mr28308090iod.101.1453916695224; Wed, 27 Jan 2016 09:44:55 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l79si13033399iod.16.2016.01.27.09.44.54; Wed, 27 Jan 2016 09:44:55 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6E0FE61822; Wed, 27 Jan 2016 17:44:54 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=J2IAf5XY; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D2CF5617C8; Wed, 27 Jan 2016 17:44:49 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 90C14617E2; Wed, 27 Jan 2016 17:44:48 +0000 (UTC) Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by lists.linaro.org (Postfix) with ESMTPS id CAA5A617AA for ; Wed, 27 Jan 2016 17:44:47 +0000 (UTC) Received: by mail-wm0-f45.google.com with SMTP id n5so38172062wmn.0 for ; Wed, 27 Jan 2016 09:44:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=i1CNAg0JL57e1a/3OlIOQQL1Oq+jcE90+s9VGW2kwaA=; b=J2IAf5XYba5hbzOTTluxH8lMDPhBpybVpEbEiP4zRdsb4i6TKxZNQ93igNg4BbLkzn RchhC/4WtY1dsiiwK+7Xt6+seuSBjCFrESjLPk8QpQnzwUXTEuQ/qFUnbt3wRMdqiJDz V7ChRzeSgGeWFdGopCNphNqwX+QlN3obD1Y78= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=i1CNAg0JL57e1a/3OlIOQQL1Oq+jcE90+s9VGW2kwaA=; b=i4Ck43HVmn9smekpnllSgfQH06LkzVZ4a6G/hL9y6UXNCbyuy3vYgkjzwc/hYU8toX ZfLepl/n3Fg7CgPtyuIDCjjXdosbbPVrXMsEzYk+IWqP1dMwJknoZAFt5m6DqEw3LSpp ccPi31iScNlEhORiTzvtLvjhBt7JcWCv9+IF9jXW3VxnrxmpPofi6mTeB+F7ZeYWD37v 0WcLhPW+zwMuqCoUjDdIfk3YyiSJQ4La9hhuIxPDGNPmNr7vVpx5AGEcNB8IJVHAKRCr mBxtBFO6/qrAY9vaDEfY/8D88+OsIO8NRfFrZiZL/5WTQFYhlpzs0juZ9xKB7WEZ8Idu un3g== X-Gm-Message-State: AG10YOQ+tWvfB2PJzCgxA/GIbnMa/bPCpmdqDIIL1ABm+U/sqngEWOPkCJK27RtS++GXcO85PEY= X-Received: by 10.28.150.72 with SMTP id y69mr29988968wmd.17.1453916686887; Wed, 27 Jan 2016 09:44:46 -0800 (PST) Received: from localhost.localdomain ([195.11.233.227]) by smtp.googlemail.com with ESMTPSA id 193sm9342448wmg.16.2016.01.27.09.44.46 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Jan 2016 09:44:46 -0800 (PST) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Wed, 27 Jan 2016 17:44:30 +0000 Message-Id: <1453916670-23975-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic: packet_io: fix array indexing in pktin_deq_multi() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" 'j' is incremented twice, therefore every second element of hdr_tbl is garbage. Introduced in f3c1e77f "linux-generic: pktio: optimize pktin_deq_multi". Signed-off-by: Zoltan Kiss Reviewed-by: Bill Fischofer diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index cda1900..540cdb8 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -640,7 +640,7 @@ int pktin_deq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int num) /* Queue the rest for later */ for (j = 0; i < pkts; i++, j++) { buf = _odp_packet_to_buffer(pkt_tbl[i]); - hdr_tbl[j++] = odp_buf_to_hdr(buf); + hdr_tbl[j] = odp_buf_to_hdr(buf); } if (j)