diff options
author | Andreas Färber <afaerber@suse.de> | 2013-02-12 23:16:06 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-13 11:57:25 -0600 |
commit | cc2a90432d9cb7546a2c4360ad7200a2fb3af31a (patch) | |
tree | 1ab3f28a1e606937e4d51abb93145d2ed72cdb19 /net | |
parent | 91b0a8f33419573c1d741e49559bfb666fd8b1f0 (diff) | |
download | qemu-cc2a90432d9cb7546a2c4360ad7200a2fb3af31a.tar.gz qemu-cc2a90432d9cb7546a2c4360ad7200a2fb3af31a.tar.bz2 qemu-cc2a90432d9cb7546a2c4360ad7200a2fb3af31a.zip |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/net.c | 4 |
1 files changed, 3 insertions, 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) |