platform/surface: aggregator: Do not return uninitialized value
authorMaximilian Luz <luzmaximilian@gmail.com>
Fri, 4 Jun 2021 21:09:06 +0000 (23:09 +0200)
committerHans de Goede <hdegoede@redhat.com>
Wed, 16 Jun 2021 15:47:54 +0000 (17:47 +0200)
The status variable in ssam_nf_refcount_disable_free() is only set when
the reference count equals zero. Otherwise, it is returned
uninitialized. Fix this by always initializing status to zero.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 640ee17199e4 ("platform/surface: aggregator: Allow enabling of events without notifiers")
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20210604210907.25738-2-luzmaximilian@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/surface/aggregator/controller.c

index 6646f4d6e10df9214cea599f65d495d6511d5ad9..634399387d76df54c829c0086d9306710bcfb649 100644 (file)
@@ -2228,7 +2228,7 @@ static int ssam_nf_refcount_disable_free(struct ssam_controller *ctrl,
        const struct ssam_event_registry reg = entry->key.reg;
        const struct ssam_event_id id = entry->key.id;
        struct ssam_nf *nf = &ctrl->cplt.event.notif;
-       int status;
+       int status = 0;
 
        lockdep_assert_held(&nf->lock);