diff mbox series

[v3,1/1] linux-gen: cls: fix: invalid queue handle check for hashing

Message ID 1516860016-16876-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v3,1/1] linux-gen: cls: fix: invalid queue handle check for hashing | expand

Commit Message

Github ODP bot Jan. 25, 2018, 6 a.m. UTC
From: Balasubramanian Manoharan <bala.manoharan@linaro.org>


invalid queue handle check should not be done for hash queues
Fixes: https://bugs.linaro.org/show_bug.cgi?id=3577

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>

---
/** Email created from pull request 407 (bala-manoharan:BUG3577)
 ** https://github.com/Linaro/odp/pull/407
 ** Patch: https://github.com/Linaro/odp/pull/407.patch
 ** Base sha: 984686b0763495c6dd97d2094f292fc7e01937d0
 ** Merge commit sha: 18b90b4441f835f917682914975ce35c8bf1affe
 **/
 platform/linux-generic/odp_classification.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c
index 668b41eb1..85353a12f 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -988,8 +988,10 @@  int cls_classify_packet(pktio_entry_t *entry, const uint8_t *base,
 	if (cos == NULL)
 		return -EINVAL;
 
-	if (cos->s.queue == ODP_QUEUE_INVALID ||
-	    cos->s.pool == ODP_POOL_INVALID)
+	if (cos->s.queue == ODP_QUEUE_INVALID && cos->s.num_queue == 1)
+		return -EFAULT;
+
+	if (cos->s.pool == ODP_POOL_INVALID)
 		return -EFAULT;
 
 	*pool = cos->s.pool;