diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-03-22 09:50:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-22 12:57:19 -0400 |
commit | c3824d21eb653fe7017476724257ccaa8bf3d9e1 (patch) | |
tree | 1e037cc43b40385ba31b2d7ef24275165c294cf0 /net/rxrpc | |
parent | 99b437a9257cb6b267bf32adfb7675948dc6d485 (diff) |
rxrpc: Check allocation failure.
alloc_skb() can return NULL.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/ar-accept.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/rxrpc/ar-accept.c b/net/rxrpc/ar-accept.c index 77228f28fa36..2d744f22a9a1 100644 --- a/net/rxrpc/ar-accept.c +++ b/net/rxrpc/ar-accept.c | |||
@@ -88,6 +88,11 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local, | |||
88 | 88 | ||
89 | /* get a notification message to send to the server app */ | 89 | /* get a notification message to send to the server app */ |
90 | notification = alloc_skb(0, GFP_NOFS); | 90 | notification = alloc_skb(0, GFP_NOFS); |
91 | if (!notification) { | ||
92 | _debug("no memory"); | ||
93 | ret = -ENOMEM; | ||
94 | goto error_nofree; | ||
95 | } | ||
91 | rxrpc_new_skb(notification); | 96 | rxrpc_new_skb(notification); |
92 | notification->mark = RXRPC_SKB_MARK_NEW_CALL; | 97 | notification->mark = RXRPC_SKB_MARK_NEW_CALL; |
93 | 98 | ||
@@ -189,6 +194,7 @@ invalid_service: | |||
189 | ret = -ECONNREFUSED; | 194 | ret = -ECONNREFUSED; |
190 | error: | 195 | error: |
191 | rxrpc_free_skb(notification); | 196 | rxrpc_free_skb(notification); |
197 | error_nofree: | ||
192 | _leave(" = %d", ret); | 198 | _leave(" = %d", ret); |
193 | return ret; | 199 | return ret; |
194 | } | 200 | } |