From b429e25ce03bc7e2853b593f5d6be92d95d3c39b Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Mon, 15 Feb 2021 21:37:27 +0100 Subject: [PATCH] oeww Signed-off-by: Igor Pecovnik --- .../wireless/rtl8723ds/os_dep/osdep_service.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/wireless/rtl8723ds/os_dep/osdep_service.c b/drivers/net/wireless/rtl8723ds/os_dep/osdep_service.c index d98de2f79..3d6c53df2 100644 --- a/drivers/net/wireless/rtl8723ds/os_dep/osdep_service.c +++ b/drivers/net/wireless/rtl8723ds/os_dep/osdep_service.c @@ -1282,15 +1282,19 @@ static int isFileReadable(const char *path, u32 *sz) { struct file *fp; int ret = 0; +#ifdef set_fs mm_segment_t oldfs; +#endif char buf; fp = filp_open(path, O_RDONLY, 0); if (IS_ERR(fp)) ret = PTR_ERR(fp); else { +#ifdef set_fs oldfs = get_fs(); set_fs(KERNEL_DS); +#endif if (1 != readFile(fp, &buf, 1)) ret = PTR_ERR(fp); @@ -1303,7 +1307,9 @@ static int isFileReadable(const char *path, u32 *sz) #endif } +#ifdef set_fs set_fs(oldfs); +#endif filp_close(fp, NULL); } return ret; @@ -1319,7 +1325,9 @@ static int isFileReadable(const char *path, u32 *sz) static int retriveFromFile(const char *path, u8 *buf, u32 sz) { int ret = -1; +#ifdef set_fs mm_segment_t oldfs; +#endif struct file *fp; if (path && buf) { @@ -1327,10 +1335,14 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz) if (0 == ret) { RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); +#ifdef set_fs oldfs = get_fs(); set_fs(KERNEL_DS); ret = readFile(fp, buf, sz); set_fs(oldfs); +#else + ret = readFile(fp, buf, sz); +#endif closeFile(fp); RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret); @@ -1354,7 +1366,9 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz) static int storeToFile(const char *path, u8 *buf, u32 sz) { int ret = 0; +#ifdef set_fs mm_segment_t oldfs; +#endif struct file *fp; if (path && buf) { @@ -1362,10 +1376,14 @@ static int storeToFile(const char *path, u8 *buf, u32 sz) if (0 == ret) { RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); +#ifdef set_fs oldfs = get_fs(); set_fs(KERNEL_DS); ret = writeFile(fp, buf, sz); set_fs(oldfs); +#else + ret = writeFile(fp, buf, sz); +#endif closeFile(fp); RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret); -- Created with Armbian build tools https://github.com/armbian/build