hw/timer/sse-timer: Propagate eventual error in sse_timer_realize()
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Fri, 12 Mar 2021 00:18:45 +0000 (01:18 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 12 Mar 2021 12:43:52 +0000 (12:43 +0000)
If the SSECounter link is absent, we set an error message
in sse_timer_realize() but forgot to propagate this error.
Add the missing 'return'.

Fixes: CID 1450755 (Null pointer dereferences)
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20210312001845.1562670-1-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/timer/sse-timer.c

index 8dbe6ac651e5ac36d9b309cadf6b99b5407fe044..f959cb9d603326976bc59d2cb43ec8867791c39f 100644 (file)
@@ -415,6 +415,7 @@ static void sse_timer_realize(DeviceState *dev, Error **errp)
 
     if (!s->counter) {
         error_setg(errp, "counter property was not set");
+        return;
     }
 
     s->counter_notifier.notify = sse_timer_counter_callback;