From: Dan Carpenter Date: Mon, 22 Mar 2010 13:07:14 +0000 (+0000) Subject: AFS: Potential null dereference X-Git-Tag: v3.0~5384 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99b437a9257cb6b267bf32adfb7675948dc6d485;p=platform%2Fkernel%2Flinux-amlogic.git AFS: Potential null dereference It seems clear from the surrounding code that xpermits is allowed to be NULL here. Signed-off-by: Dan Carpenter Signed-off-by: David Howells Signed-off-by: Linus Torvalds --- diff --git a/fs/afs/security.c b/fs/afs/security.c index 3ef5043..bb4ed14 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);