Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3824d21 authored by Tetsuo Handa's avatar Tetsuo Handa Committed by Linus Torvalds
Browse files

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 avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 99b437a9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -88,6 +88,11 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local,

	/* get a notification message to send to the server app */
	notification = alloc_skb(0, GFP_NOFS);
	if (!notification) {
		_debug("no memory");
		ret = -ENOMEM;
		goto error_nofree;
	}
	rxrpc_new_skb(notification);
	notification->mark = RXRPC_SKB_MARK_NEW_CALL;

@@ -189,6 +194,7 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local,
	ret = -ECONNREFUSED;
error:
	rxrpc_free_skb(notification);
error_nofree:
	_leave(" = %d", ret);
	return ret;
}