aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wahren <[email protected]>2022-01-23 21:02:21 +0100
committerGreg Kroah-Hartman <[email protected]>2022-01-25 16:30:16 +0100
commitaa899e686d442c63d50f4d369cc02dbbf0941cb0 (patch)
treea45b1bf9e5a4675379a9126a60b0e347db3dac97
parent914813cc523cf8b32ca8735cbf3243256e87a5a3 (diff)
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 <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index 6ef8f19fe49a..a9b6e4a178cb 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -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.