[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH v1] vl: Fix possible freed memory
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH v1] vl: Fix possible freed memory accessing |
Date: |
Fri, 19 Sep 2014 08:54:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
zhanghailiang <address@hidden> writes:
> The logic of pcmcia_socket_unregister is wrong,
> which will cause a freed memory accessing
>
> Signed-off-by: zhanghailiang <address@hidden>
> ---
> Hi,
>
> The function pcmcia_socket_unregister seemes to be unused,
> Should it be removed? Thanks.
I think we should remove the whole thing: pcmcia_sockets,
pcmcia_socket_register(), pcmcia_socket_unregister, pcmcia_info().
Here's why.
It serves just one purpose: "info pcmcia". HMP-only, therefore not a
stable interface. But is it a useful one?
The only caller of pcmcia_socket_register() is pxa2xx_pcmcia_realize(),
of device model "pxa2xx-pcmcia". As far as I can tell, used only by a
couple of ARM boards: "verdex", "mainstone", "akita", "spitz", "borzoi",
"terrier", "z2", "connex", "tosa".
Of these, only "akita", "spitz", "borzoi", "terrier" and "tosa" insert a
card into the slot, and they do so right on board initialization.
Nothing ever ejects a card from a slot. Therefore, "info pcmcia"
effectively prints a fixed, machine-specific string so far. Doesn't
sound useful to me.
If we acquire PCMCIA devices where querying status is interesting, we'll
want a QMP command, so this code will be pretty much useless.
Peter M., what do you think?