# HG changeset patch # User Keir Fraser # Date 1271162458 -3600 # Node ID 859a372efa66e6bcba8e1fd968e521cb16da12ea # Parent da90dd1a09b93ae41ab451d223ff87dca04356f5 sysctl: Fix XEN_SYSCTL_debug_keys error path. Signed-off-by: Keir Fraser --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -169,12 +169,14 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysc if ( ret ) break; + ret = -EFAULT; for ( i = 0; i < op->u.debug_keys.nr_keys; i++ ) { if ( copy_from_guest_offset(&c, op->u.debug_keys.keys, i, 1) ) - return -EFAULT; + goto out; handle_keypress(c, guest_cpu_user_regs()); } + ret = 0; } break;