net: Avoid NULL function pointer dereference on cleanup
The pSeries machine and some other devices don't supply a cleanup callback. Revert part of 1ceef9f27359cbe92ef124bf74de6f792e71f6fb that started calling it unconditionally. Cc: Jason Wang <jasowang@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1360707366-9271-1-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
91b0a8f334
commit
cc2a90432d
@ -287,8 +287,10 @@ static void qemu_cleanup_net_client(NetClientState *nc)
|
|||||||
{
|
{
|
||||||
QTAILQ_REMOVE(&net_clients, nc, next);
|
QTAILQ_REMOVE(&net_clients, nc, next);
|
||||||
|
|
||||||
|
if (nc->info->cleanup) {
|
||||||
nc->info->cleanup(nc);
|
nc->info->cleanup(nc);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void qemu_free_net_client(NetClientState *nc)
|
static void qemu_free_net_client(NetClientState *nc)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user