mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-19 12:29:02 +02:00
fscache_cookie_enabled: check cookie is valid before accessing it
commit 0dc54bd4d6
upstream.
fscache_cookie_enabled() could be called on NULL cookies and cause a
null pointer dereference when accessing cookie flags: just make sure
the cookie is valid first
Suggested-by: David Howells <dhowells@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Cc: Jeffrey E Altman <jaltman@auristor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
734eb1fd20
commit
ef3047fca1
|
@ -167,7 +167,7 @@ struct fscache_cookie {
|
|||
|
||||
static inline bool fscache_cookie_enabled(struct fscache_cookie *cookie)
|
||||
{
|
||||
return test_bit(FSCACHE_COOKIE_ENABLED, &cookie->flags);
|
||||
return fscache_cookie_valid(cookie) && test_bit(FSCACHE_COOKIE_ENABLED, &cookie->flags);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue
Block a user