From efcd1d175bbe0beac2ec7ec246952a79d88996ee Mon Sep 17 00:00:00 2001 From: Chris Lew Date: Mon, 3 Oct 2022 09:58:31 -0700 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 Signed-off-by: Jay Jayanna Signed-off-by: Chris Lew --- net/qrtr/af_qrtr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c index 63d7e336a88e..fe5d9cb49e85 100644 --- a/net/qrtr/af_qrtr.c +++ b/net/qrtr/af_qrtr.c @@ -572,8 +572,10 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len) qrtr_tx_resume(node, skb); } 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)) { qrtr_port_put(ipc);