ANDROID: Fix the CONFIG_ANDROID_VENDOR_OEM_DATA=n build

Scripts like
https://github.com/bvanassche/build-scsi-drivers/blob/main/build-scsi-drivers
do not set CONFIG_ANDROID_VENDOR_OEM_DATA. Hence this patch that
unbreaks the CONFIG_ANDROID_VENDOR_OEM_DATA=n build.

Fixes: 291dfda577 ("ANDROID: init_task: Init android vendor and oem data")
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Change-Id: Ic8223e69495fce7e2d0531313856ea5ed21659b7
This commit is contained in:
Bart Van Assche 2022-06-02 16:16:19 -07:00
parent 45a91f3011
commit 78d6de7863
2 changed files with 4 additions and 0 deletions

View File

@ -214,8 +214,10 @@ struct task_struct init_task
#ifdef CONFIG_SECCOMP_FILTER
.seccomp = { .filter_count = ATOMIC_INIT(0) },
#endif
#ifdef CONFIG_ANDROID_VENDOR_OEM_DATA
.android_vendor_data1 = {0, },
.android_oem_data1 = {0, },
#endif
};
EXPORT_SYMBOL(init_task);

View File

@ -1014,8 +1014,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
#ifdef CONFIG_MEMCG
tsk->active_memcg = NULL;
#endif
#ifdef CONFIG_ANDROID_VENDOR_OEM_DATA
memset(&tsk->android_vendor_data1, 0, sizeof(tsk->android_vendor_data1));
memset(&tsk->android_oem_data1, 0, sizeof(tsk->android_oem_data1));
#endif
return tsk;
free_stack: