From 2804937cf5f16227d27e4eb7a2378a36598e54d7 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 22 Mar 2010 09:58:04 -0700 Subject: [PATCH] --- yaml --- r: 188848 b: refs/heads/master c: e91924158d89086357e46887c23d714cfb4e05ea h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/cpu/perf_event_amd.c | 8 +++++--- trunk/fs/afs/security.c | 5 +++-- trunk/ipc/syscall.c | 2 +- trunk/net/rxrpc/ar-accept.c | 6 ++++++ 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 49ed89e5e2e9..faa363c084ec 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5b89d2f9ace1970324facc68ca9b8fae19ce8096 +refs/heads/master: e91924158d89086357e46887c23d714cfb4e05ea diff --git a/trunk/arch/x86/kernel/cpu/perf_event_amd.c b/trunk/arch/x86/kernel/cpu/perf_event_amd.c index 573458f1caf2..b87e0b6970cb 100644 --- a/trunk/arch/x86/kernel/cpu/perf_event_amd.c +++ b/trunk/arch/x86/kernel/cpu/perf_event_amd.c @@ -348,10 +348,12 @@ static void amd_pmu_cpu_offline(int cpu) raw_spin_lock(&amd_nb_lock); - if (--cpuhw->amd_nb->refcnt == 0) - kfree(cpuhw->amd_nb); + if (cpuhw->amd_nb) { + if (--cpuhw->amd_nb->refcnt == 0) + kfree(cpuhw->amd_nb); - cpuhw->amd_nb = NULL; + cpuhw->amd_nb = NULL; + } raw_spin_unlock(&amd_nb_lock); } diff --git a/trunk/fs/afs/security.c b/trunk/fs/afs/security.c index 3ef504370034..bb4ed144d0e4 100644 --- a/trunk/fs/afs/security.c +++ b/trunk/fs/afs/security.c @@ -189,8 +189,9 @@ void afs_cache_permit(struct afs_vnode *vnode, struct key *key, long acl_order) if (!permits) goto out_unlock; - memcpy(permits->permits, xpermits->permits, - count * sizeof(struct afs_permit)); + if (xpermits) + memcpy(permits->permits, xpermits->permits, + count * sizeof(struct afs_permit)); _debug("key %x access %x", key_serial(key), vnode->status.caller_access); diff --git a/trunk/ipc/syscall.c b/trunk/ipc/syscall.c index 355a3da9ec73..1d6f53f6b562 100644 --- a/trunk/ipc/syscall.c +++ b/trunk/ipc/syscall.c @@ -13,7 +13,7 @@ #include #include -SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, int, second, +SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second, unsigned long, third, void __user *, ptr, long, fifth) { int version, ret; diff --git a/trunk/net/rxrpc/ar-accept.c b/trunk/net/rxrpc/ar-accept.c index 77228f28fa36..2d744f22a9a1 100644 --- a/trunk/net/rxrpc/ar-accept.c +++ b/trunk/net/rxrpc/ar-accept.c @@ -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; }