|
From: | Robert Reif |
Subject: | Re: [Qemu-devel] [PATCH] fix possible NULL pointer use in hw/ptimer.c |
Date: | Wed, 02 Jan 2008 21:57:34 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040308 |
Paul Brook wrote:
I am in the process of fixing the sparc ptimer caller to gracefully handle OOM.s = (ptimer_state *)qemu_mallocz(sizeof(ptimer_state)); + if (!s) + return NULL;None of the callers bother to check the return value, And even if they did I don't think there's any point trying to gracefully handle OOM. Just abort and be done with it.
We currently don't check the return value in the init function where the new timer is created but do check it wherever it is used which is backwards and wasteful. You would prefer that qemu just segfaults rather than die gracefully?
[Prev in Thread] | Current Thread | [Next in Thread] |