From 37ed76a745b099565b4ae7915f0441b1316bf108 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 4 Jun 2021 23:09:06 +0200 Subject: platform/surface: aggregator: Do not return uninitialized value 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 Fixes: 640ee17199e4 ("platform/surface: aggregator: Allow enabling of events without notifiers") Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20210604210907.25738-2-luzmaximilian@gmail.com Signed-off-by: Hans de Goede --- drivers/platform/surface/aggregator/controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/platform/surface') diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c index 6646f4d6e10d..634399387d76 100644 --- a/drivers/platform/surface/aggregator/controller.c +++ b/drivers/platform/surface/aggregator/controller.c @@ -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); -- cgit v1.2.3-59-g8ed1b