From a51b58c8e755d3b1a1fecfc710f6bb3ea420f7fb Mon Sep 17 00:00:00 2001 From: Jay Jayanna Date: Wed, 17 Jun 2020 14:29:36 -0700 Subject: [PATCH] net: qrtr: Fix early exit in del client and bye cmds When del client and bye command packets are sent out, if there is an error in sending, continue with the loop to send to the rest of the clients. The current implementation bails out when the send fails. This is causing dropping of these packets to the rest of the clients. Change-Id: If9111216061e64ba1777590edba128b011625250 Signed-off-by: Jay Jayanna --- net/qrtr/ns.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c index 087c0e2c2012..8e7a125b72e5 100644 --- a/net/qrtr/ns.c +++ b/net/qrtr/ns.c @@ -375,10 +375,9 @@ static int ctrl_cmd_bye(struct sockaddr_qrtr *from) msg.msg_namelen = sizeof(sq); ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt)); - if (ret < 0 && ret != -ENODEV) { - pr_err("failed to send bye cmd %d\n", ret); - return ret; - } + if (ret < 0 && ret != -ENODEV) + pr_err("send bye failed: [0x%x:0x%x] 0x%x ret: %d\n", + srv->service, srv->instance, srv->port, ret); } return 0; @@ -450,10 +449,9 @@ static int ctrl_cmd_del_client(struct sockaddr_qrtr *from, msg.msg_namelen = sizeof(sq); ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt)); - if (ret < 0 && ret != -ENODEV) { - pr_err("failed to send del client cmd %d\n", ret); - return ret; - } + if (ret < 0 && ret != -ENODEV) + pr_err("del client cmd failed: [0x%x:0x%x] 0x%x %d\n", + srv->service, srv->instance, srv->port, ret); } return 0;