@@ -463,6 +463,8 @@ static int pit_ioport_read(struct kvm_io_device *this,
    struct kvm *kvm = pit->kvm;
    int ret, count;
    struct kvm_kpit_channel_state *s;
+ Â Â Â if (len < 0)
+ Â Â Â Â Â Â Â return -EOPNOTSUPP;
    if (!pit_in_range(addr))
        return -EOPNOTSUPP;
@@ -516,6 +518,7 @@ static int pit_ioport_read(struct kvm_io_device *this,
    if (len > sizeof(ret))
        len = sizeof(ret);
+
    memcpy(data, (char *)&ret, len);
    mutex_unlock(&pit_state->lock);
@@ -547,6 +550,9 @@ static int speaker_ioport_read(struct kvm_io_device *this,
    struct kvm *kvm = pit->kvm;
    unsigned int refresh_clock;
    int ret;
+
+ Â Â Â if (len < 0)
+ Â Â Â Â Â Â Â return -EOPNOTSUPP;
    if (addr != KVM_SPEAKER_BASE_ADDRESS)
        return -EOPNOTSUPP;
--
To unsubscribe from this list: send the line "unsubscribe kvm" in