All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/timer/sse-timer: Propagate eventual error in sse_timer_realize()
@ 2021-03-12  0:18 Philippe Mathieu-Daudé
  2021-03-12 12:44 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-03-12  0:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-arm, Richard Henderson, Philippe Mathieu-Daudé

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>
---
 hw/timer/sse-timer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/timer/sse-timer.c b/hw/timer/sse-timer.c
index 8dbe6ac651e..f959cb9d603 100644
--- a/hw/timer/sse-timer.c
+++ b/hw/timer/sse-timer.c
@@ -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;
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hw/timer/sse-timer: Propagate eventual error in sse_timer_realize()
  2021-03-12  0:18 [PATCH] hw/timer/sse-timer: Propagate eventual error in sse_timer_realize() Philippe Mathieu-Daudé
@ 2021-03-12 12:44 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2021-03-12 12:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: qemu-arm, Richard Henderson, QEMU Developers

On Fri, 12 Mar 2021 at 00:18, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> 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>
> ---
>  hw/timer/sse-timer.c | 1 +
>  1 file changed, 1 insertion(+)



Applied to target-arm.next, thanks.

-- PMM


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-12 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12  0:18 [PATCH] hw/timer/sse-timer: Propagate eventual error in sse_timer_realize() Philippe Mathieu-Daudé
2021-03-12 12:44 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.