summaryrefslogtreecommitdiffstats
path: root/fs/afs/security.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-03-22 14:07:14 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-22 17:57:19 +0100
commit99b437a9257cb6b267bf32adfb7675948dc6d485 (patch)
tree21173f7d22026bf37455cc7baa32e71acff82e8c /fs/afs/security.c
parentppc64 sys_ipc breakage in 2.6.34-rc2 (diff)
downloadlinux-99b437a9257cb6b267bf32adfb7675948dc6d485.tar.xz
linux-99b437a9257cb6b267bf32adfb7675948dc6d485.zip
AFS: Potential null dereference
It seems clear from the surrounding code that xpermits is allowed to be NULL here. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/afs/security.c')
-rw-r--r--fs/afs/security.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/afs/security.c b/fs/afs/security.c
index 3ef504370034..bb4ed144d0e4 100644
--- a/fs/afs/security.c
+++ b/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);