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: a1037b8e1b ("ANDROID: init_task: Init android vendor and oem data")
Change-Id: Ic8223e69495fce7e2d0531313856ea5ed21659b7
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
Bart Van Assche
2022-06-02 16:16:19 -07:00
parent 2a6fab1479
commit d68ba8769b
2 changed files with 4 additions and 0 deletions

View File

@@ -213,8 +213,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

@@ -985,8 +985,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
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
trace_android_vh_dup_task_struct(tsk, orig);
return tsk;