mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
net: Avoid NULL function pointer dereference on cleanup
The pSeries machine and some other devices don't supply a cleanup
callback. Revert part of 1ceef9f273
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
1 changed files with 3 additions and 1 deletions
|
@ -287,7 +287,9 @@ static void qemu_cleanup_net_client(NetClientState *nc)
|
|||
{
|
||||
QTAILQ_REMOVE(&net_clients, nc, next);
|
||||
|
||||
nc->info->cleanup(nc);
|
||||
if (nc->info->cleanup) {
|
||||
nc->info->cleanup(nc);
|
||||
}
|
||||
}
|
||||
|
||||
static void qemu_free_net_client(NetClientState *nc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue