From 3b50159e8cd61eced37bee5f7c005dfcd55b09ef Mon Sep 17 00:00:00 2001 From: Deepak Kumar Singh Date: Tue, 6 Oct 2020 23:25:13 +0530 Subject: [PATCH] net: qrtr: Return -ENODEV error code if port not found Post function is called from interrupt context. Returning same error code in all cases rsults in excessive prints which can cause irq throttling. Return -ENODEV when port lookup fails in post function. CRs-Fixed: 2790559 Change-Id: I75384b2116cb2fe1bbeaa2dac91157345f0bab54 Signed-off-by: Deepak Kumar Singh --- net/qrtr/qrtr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 6ccb13c598fa..30871dcebf57 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -822,8 +822,10 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len) __pm_wakeup_event(node->ws, 0); } else { ipc = qrtr_port_lookup(cb->dst_port); - if (!ipc) - goto err; + if (!ipc) { + kfree_skb(skb); + return -ENODEV; + } if (sock_queue_rcv_skb(&ipc->sk, skb)) goto err;