ANDROID: GKI: Add initialization for rwsem's oem_data and vendor_data.

Add initialization for rwsem's oem_data and vendor_data.
The __init_rwsem() already contains a hook, but this function
may be called before the rwsem_init hook is registered,
causing some rwsem's oem_data to be uninitialized and
causing unpredictable errors

Bug: 351133539

Change-Id: I7bbb83894d200102bc7d84e91678f164529097a0
Signed-off-by: zhujingpeng <zhujingpeng@vivo.com>
This commit is contained in:
zhujingpeng 2024-07-04 22:08:43 +08:00 committed by Treehugger Robot
parent 1036ce8d67
commit aaca6b10f1

View File

@ -345,9 +345,8 @@ void __init_rwsem(struct rw_semaphore *sem, const char *name,
#ifdef CONFIG_RWSEM_SPIN_ON_OWNER
osq_lock_init(&sem->osq);
#endif
#ifdef CONFIG_ANDROID_VENDOR_OEM_DATA
sem->android_vendor_data1 = 0;
#endif
android_init_vendor_data(sem, 1);
android_init_oem_data(sem, 1);
trace_android_vh_rwsem_init(sem);
}
EXPORT_SYMBOL(__init_rwsem);