isa-superio: validate floppy.count value
Ensure that the value is valid; it can only be zero or one. And never create a floppy disk controller if it is zero. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
deac624f22
commit
41514c0a77
@ -116,7 +116,9 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
|
||||
}
|
||||
|
||||
/* Floppy disc */
|
||||
if (!k->floppy.is_enabled || k->floppy.is_enabled(sio, 0)) {
|
||||
assert(k->floppy.count <= 1);
|
||||
if (k->floppy.count &&
|
||||
(!k->floppy.is_enabled || k->floppy.is_enabled(sio, 0))) {
|
||||
isa = isa_new(TYPE_ISA_FDC);
|
||||
d = DEVICE(isa);
|
||||
if (k->floppy.get_iobase) {
|
||||
|
Loading…
Reference in New Issue
Block a user