From b07fa1643988d192893c7f8108594f3dd541537f Mon Sep 17 00:00:00 2001 From: Sherry Sun Date: Tue, 6 Apr 2021 19:12:34 +0800 Subject: [PATCH] mwifiex: fix build error on Linux5.12 Signed-off-by: Sherry Sun Reviewed-by: yang.tian --- mxm_wifiex/wlan_src/mlinux/moal_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_main.c b/mxm_wifiex/wlan_src/mlinux/moal_main.c index cd8fbea..18798ae 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_main.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_main.c @@ -7001,7 +7001,11 @@ t_void woal_store_ssu_dump(moal_handle *phandle, mlan_event *pmevent) if (IS_ERR(dentry)) { goto save_ssudump; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0) vfs_mkdir(path.dentry->d_inode, dentry, 0777); +#else + vfs_mkdir(&init_user_ns, path.dentry->d_inode, dentry, 0777); +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0) mutex_unlock(&path.dentry->d_inode->i_mutex); #else @@ -7734,7 +7738,11 @@ void woal_create_dump_dir(moal_handle *phandle, char *dir_buf, int buf_size) dir_buf); goto default_dir; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0) ret = vfs_mkdir(path.dentry->d_inode, dentry, 0777); +#else + ret = vfs_mkdir(&init_user_ns, path.dentry->d_inode, dentry, 0777); +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0) mutex_unlock(&path.dentry->d_inode->i_mutex); #else