From 04e9fbc09d517455b23903c9d5e7941a9ed59b01 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Mon, 9 Jan 2012 09:46:32 -0800 Subject: Fix emulator crash restoring pipes from snapshot The emulator crashes when loading a goldfish pipe from snapshot if it was still in PipeConnection state when saved, since there is no service associated with the pipe. Check for service existence before dereferencing the service pointer. Change-Id: I9093bdf403fd3532e9fb6584b98994d9d4dc686c --- hw/goldfish_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/goldfish_pipe.c b/hw/goldfish_pipe.c index 3c076f1..97daefb 100644 --- a/hw/goldfish_pipe.c +++ b/hw/goldfish_pipe.c @@ -284,7 +284,7 @@ pipe_load( PipeDevice* dev, QEMUFile* file ) } if (pipe->funcs->load) { - pipe->opaque = pipe->funcs->load(pipe, service->opaque, pipe->args, file); + pipe->opaque = pipe->funcs->load(pipe, service ? service->opaque : NULL, pipe->args, file); if (pipe->opaque == NULL) { AFREE(pipe); return NULL; -- cgit v1.1