]> git.baikalelectronics.ru Git - kernel.git/commit
platform/surface: aggregator_cdev: Fix access of uninitialized variables
authorMaximilian Luz <luzmaximilian@gmail.com>
Mon, 11 Jan 2021 15:48:50 +0000 (16:48 +0100)
committerHans de Goede <hdegoede@redhat.com>
Wed, 13 Jan 2021 09:30:21 +0000 (10:30 +0100)
commit0ac0cffb0eba819832aa62f6683ec9ad8d47d8bd
tree787bd8fdb280a46bfd5bf7354a00696e92328f6d
parentde619fa39cde4fb921212a9b512d8ffdd4db152c
platform/surface: aggregator_cdev: Fix access of uninitialized variables

When copy_struct_from_user() in ssam_cdev_request() fails, we directly
jump to the 'out' label. In this case, however 'spec' and 'rsp' are not
initialized, but we still access fields of those variables. Fix this by
initializing them at the time of their declaration.

Reported-by: Colin Ian King <colin.king@canonical.com>
Fixes: 3f35ea58e598 ("platform/surface: Add Surface Aggregator user-space interface")
Addresses-Coverity: ("Uninitialized pointer read")
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20210111154851.325404-2-luzmaximilian@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/surface/surface_aggregator_cdev.c