mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
staging: vchiq_arm: Avoid NULL ptr deref in vchiq_dump_platform_instances
vchiq_get_state() can return a NULL pointer. So handle this cases and avoid a NULL pointer derefence in vchiq_dump_platform_instances. Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Link: https://lore.kernel.org/r/1642968143-19281-17-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
914813cc52
commit
aa899e686d
1 changed files with 3 additions and 0 deletions
|
@ -1204,6 +1204,9 @@ int vchiq_dump_platform_instances(void *dump_context)
|
|||
int len;
|
||||
int i;
|
||||
|
||||
if (!state)
|
||||
return -ENOTCONN;
|
||||
|
||||
/*
|
||||
* There is no list of instances, so instead scan all services,
|
||||
* marking those that have been dumped.
|
||||
|
|
Loading…
Reference in a new issue