summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@codeaurora.org>2016-12-15 08:13:20 -0700
committerKarthikeyan Ramasubramanian <kramasub@codeaurora.org>2016-12-15 08:16:35 -0700
commit32c229060ca33b816c50eedc136ea2800f9974df (patch)
treeb3dc07648a65e10302f5adb7f85f6dbf1540f17a
parent2be8fc81c3adef891480d3abd19639860d838443 (diff)
net: ipc_router: Register services only on client port
Allowing services to be registered on a non-client port will cause either an existing service or a control port to be over-written. This will cause undefined functional behavior. Allow the services to be registered only on client ports. CRs-Fixed: 1101792 Change-Id: If6cfc75e9314204b7b44957f1598a8a2e1a45325 Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
-rw-r--r--net/ipc_router/ipc_router_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipc_router/ipc_router_core.c b/net/ipc_router/ipc_router_core.c
index 008d034fcf8f..d23799a5b260 100644
--- a/net/ipc_router/ipc_router_core.c
+++ b/net/ipc_router/ipc_router_core.c
@@ -2809,6 +2809,9 @@ int msm_ipc_router_register_server(struct msm_ipc_port *port_ptr,
if (!port_ptr || !name)
return -EINVAL;
+ if (port_ptr->type != CLIENT_PORT)
+ return -EINVAL;
+
if (name->addrtype != MSM_IPC_ADDR_NAME)
return -EINVAL;