diff mbox series

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

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

Commit Message

Github ODP bot Jan. 23, 2018, 4 p.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: b122176ee59494dd957f0f5ff41d4b55a1477e13
 ** Merge commit sha: e8cda026ba20a27239a265ec4a16b1163051bbf1
 **/
 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 276430923..d97807df0 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -979,8 +979,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;