From 3ae3cf658caf18885f1612072158e37e8273ffa6 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Tue, 15 Jul 2014 16:57:05 -0600 Subject: [PATCH] net: ipc_router: Handle error condition If a message buffer cannot be returned due to allocation failure, then return appropriate error code. Change-Id: I39bbf857c1aa6e302ea0af8c9a144002edb38d29 Signed-off-by: Karthikeyan Ramasubramanian --- net/ipc_router/ipc_router_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/ipc_router/ipc_router_core.c b/net/ipc_router/ipc_router_core.c index c37aaa95944d..a26d862cba4d 100644 --- a/net/ipc_router/ipc_router_core.c +++ b/net/ipc_router/ipc_router_core.c @@ -2765,8 +2765,11 @@ int msm_ipc_router_read_msg(struct msm_ipc_port *port_ptr, } *data = msm_ipc_router_skb_to_buf(pkt->pkt_fragment_q, ret); - if (!(*data)) + if (!(*data)) { IPC_RTR_ERR("%s: Buf conversion failed\n", __func__); + release_pkt(pkt); + return -ENOMEM; + } *len = ret; release_pkt(pkt);