aboutsummaryrefslogtreecommitdiff
path: root/usb-linux.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-06-15 13:30:39 +0530
committerAurelien Jarno <aurelien@aurel32.net>2010-06-30 22:35:57 +0200
commit03c71553ad735068e2bf166e629026fc78dbb4b9 (patch)
tree9579f3c981073d57a8aacd751da33fb09ca78fe9 /usb-linux.c
parentab5ea55805f89a26e35a8becb072049fec0f9d01 (diff)
net: Fix VM start with '-net none'
Commit 50e32ea8f31035877decc10f1075aa0e619e09cb changed the behaviour for the return type of net_client_init() when a nic type with no init method was specified. 'none' is one such nic type. Instead of returning 0, which gets interpreted as an index into the nd_table[] array, we switched to returning -1, which signifies an error as well. That broke VM start with '-net none'. Testing was only done with the monitor command 'pci_add', which doesn't fail. The correct fix would still be to return 0+ values from net_client_init() only when the return value can be used as an index to refer to an entry in nd_table[]. With the current code, callers can erroneously poke into nd_table[0] when -net nic is used, which can lead to badness. However, this commit just returns to the previous behaviour before the offending commit. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'usb-linux.c')
0 files changed, 0 insertions, 0 deletions