Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ddce40df6e14dd474bbd9daa006dcc290dea6326 Commit: ddce40df6e14dd474bbd9daa006dcc290dea6326 Parent: e4cc6ee2e40bdd57990577b7f851fa2ca48edf47 Author: Peter Zijlstra <[EMAIL PROTECTED]> AuthorDate: Wed May 9 08:30:11 2007 +0200 Committer: Trond Myklebust <[EMAIL PROTECTED]> CommitDate: Wed May 9 17:58:00 2007 -0400
sunrpc: fix crash in rpc_malloc() While the comment says: * To prevent rpciod from hanging, this allocator never sleeps, * returning NULL if the request cannot be serviced immediately. The function does not actually check for NULL pointers being returned. Signed-off-by: Peter Zijlstra <[EMAIL PROTECTED]> Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]> --- net/sunrpc/sched.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index b28a0b0..b011eb6 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -767,6 +767,10 @@ void *rpc_malloc(struct rpc_task *task, size_t size) buf = mempool_alloc(rpc_buffer_mempool, gfp); else buf = kmalloc(size, gfp); + + if (!buf) + return NULL; + buf->len = size; dprintk("RPC: %5u allocated buffer of size %zu at %p\n", task->tk_pid, size, buf); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html