Skip to content

Commit

Permalink
Fixed issue on Linux kernel 5.18+
Browse files Browse the repository at this point in the history
  • Loading branch information
lelegard committed Dec 31, 2022
1 parent ad515bd commit 526d8af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions linux-drivers/it950x_driver/it950x-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ static DWORD DRV_IrTblDownload(IN void* handle)
struct file *filp;
unsigned char b_buf[512] ;
int i, fileSize;
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
mm_segment_t oldfs;
#endif

deb_data("- Enter %s Function -\n",__FUNCTION__);

Expand All @@ -85,7 +87,7 @@ static DWORD DRV_IrTblDownload(IN void* handle)
#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
oldfs = get_fs();
set_fs(KERNEL_DS);
#else
#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
oldfs = force_uaccess_begin();
#endif

Expand Down Expand Up @@ -113,7 +115,7 @@ static DWORD DRV_IrTblDownload(IN void* handle)
filp_close(filp, NULL);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0)
set_fs(oldfs);
#else
#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
force_uaccess_end(oldfs);
#endif

Expand Down

0 comments on commit 526d8af

Please sign in to comment.