Skip to content

Commit

Permalink
x86/xen: Remove undefined behavior in setup_features()
Browse files Browse the repository at this point in the history
[ Upstream commit ecb6237 ]

1 << 31 is undefined. So switch to 1U << 31.

Fixes: 5ead97c ("xen: Core Xen implementation")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20220617103037.57828-1-julien@xen.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Julien Grall authored and gregkh committed Jun 29, 2022
1 parent b60c375 commit cc649a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/xen/features.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ void xen_setup_features(void)
if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0)
break;
for (j = 0; j < 32; j++)
xen_features[i * 32 + j] = !!(fi.submap & 1<<j);
xen_features[i * 32 + j] = !!(fi.submap & 1U << j);
}
}

0 comments on commit cc649a7

Please sign in to comment.