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>
This commit is contained in:
Dan Carpenter 2010-03-22 13:07:14 +00:00 коммит произвёл Linus Torvalds
Родитель 45575f5a42
Коммит 99b437a925
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -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);