diff options
author | Stuart Haslam <stuart.haslam@arm.com> | 2014-12-12 17:26:39 +0000 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-12-16 01:39:48 +0300 |
commit | 8a7d6bcad3ffac82b1935dfb3631f030dac9095f (patch) | |
tree | 561d48ea202b9f2838113e4248aabfbeb0ffc306 /platform/linux-generic | |
parent | e90e08a3be9e56efd0cab190f510e05d9f232dda (diff) |
linux-generic: pktio: prevent pktin_dequeue storing returned buffer
The buffer being returned shouldn't be enqueued as this will cause it to
be returned again on the next dequeue, by which point it may have been
freed via the returned reference.
Signed-off-by: Stuart Haslam <stuart.haslam@arm.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic')
-rw-r--r-- | platform/linux-generic/odp_packet_io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index a03eeb1ff..aa3717907 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -483,8 +483,8 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) tmp_hdr_tbl[j++] = buf_hdr; } - if (j) - queue_enq_multi(qentry, tmp_hdr_tbl, j); + if (j > 1) + queue_enq_multi(qentry, &tmp_hdr_tbl[1], j-1); buf_hdr = tmp_hdr_tbl[0]; return buf_hdr; } |