Commit 7c3456fd authored by Tetsuo Handa's avatar Tetsuo Handa Committed by David S. Miller

rxrpc: Check allocation failure.

alloc_skb() can return NULL.
Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 243aad83
...@@ -88,6 +88,11 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local, ...@@ -88,6 +88,11 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local,
/* get a notification message to send to the server app */ /* get a notification message to send to the server app */
notification = alloc_skb(0, GFP_NOFS); notification = alloc_skb(0, GFP_NOFS);
if (!notification) {
_debug("no memory");
ret = -ENOMEM;
goto error_nofree;
}
rxrpc_new_skb(notification); rxrpc_new_skb(notification);
notification->mark = RXRPC_SKB_MARK_NEW_CALL; notification->mark = RXRPC_SKB_MARK_NEW_CALL;
...@@ -189,6 +194,7 @@ invalid_service: ...@@ -189,6 +194,7 @@ invalid_service:
ret = -ECONNREFUSED; ret = -ECONNREFUSED;
error: error:
rxrpc_free_skb(notification); rxrpc_free_skb(notification);
error_nofree:
_leave(" = %d", ret); _leave(" = %d", ret);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment