xenoprof: avoid division by 0

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Tim Deegan committed 2013-02-15 09:42:02 +01:00
1 parent 63a47721ad
commit 085f1f2d3a
1 file changed
+7 -4
+7 -4
View File
@@ -193,6 +193,13 @@ static int alloc_xenoprof_struct(
unsigned max_max_samples;
int i;
nvcpu = 0;
for_each_vcpu ( d, v )
nvcpu++;
if ( !nvcpu )
return -EINVAL;
d->xenoprof = xzalloc(struct xenoprof);
if ( d->xenoprof == NULL )
{
@@ -209,10 +216,6 @@ static int alloc_xenoprof_struct(
return -ENOMEM;
}
nvcpu = 0;
for_each_vcpu ( d, v )
nvcpu++;
bufsize = sizeof(struct xenoprof_buf);
i = sizeof(struct event_log);
#ifdef CONFIG_COMPAT
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.