kpatch-build: fix shadow_get function

The shadow_get function does't consider the case that
'shadow is inpace', and after the shadow->data be set to the data,
it will not be the pointer. This patch fix it.

Signed-off-by: Li Bin <huawei.libin@huawei.com>
This commit is contained in:
Li Bin 2015-10-12 17:11:48 +08:00
parent f049dcf6e0
commit 495948242e
1 changed files with 3 additions and 0 deletions

View File

@ -158,6 +158,9 @@ void *kpatch_shadow_get(void *obj, char *var)
(unsigned long)obj) {
if (shadow->obj == obj && !strcmp(shadow_var(shadow), var)) {
rcu_read_unlock();
if (shadow_is_inplace(shadow))
return &(shadow->data);
return shadow->data;
}
}