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 <kramasub@codeaurora.org>
This commit is contained in:
Karthikeyan Ramasubramanian 2014-07-15 16:57:05 -06:00
parent 654c97a029
commit 3ae3cf658c
1 changed files with 4 additions and 1 deletions

View File

@ -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);