diff options
| author | Stefan Wahren <[email protected]> | 2022-01-23 21:02:21 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2022-01-25 16:30:16 +0100 |
| commit | aa899e686d442c63d50f4d369cc02dbbf0941cb0 (patch) | |
| tree | a45b1bf9e5a4675379a9126a60b0e347db3dac97 | |
| parent | 914813cc523cf8b32ca8735cbf3243256e87a5a3 (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.c | 3 |
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. |