diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/include/linuxver.h b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/include/linuxver.h index 66f38d2c02a4..c39d7b6a45f5 100755 --- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/include/linuxver.h +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/include/linuxver.h @@ -931,8 +931,13 @@ static inline struct inode *file_inode(const struct file *f) #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) +#ifdef CONFIG_NO_GKI #define vfs_write(fp, buf, len, pos) kernel_write(fp, buf, len, pos) #define vfs_read(fp, buf, len, pos) kernel_read(fp, buf, len, pos) +#else +#define vfs_write(fp, buf, len, pos) ({ UNUSED_PARAMETER(fp); UNUSED_PARAMETER(buf); UNUSED_PARAMETER(len); UNUSED_PARAMETER(pos); -EPERM; }) +#define vfs_read(fp, buf, len, pos) ({ UNUSED_PARAMETER(fp); UNUSED_PARAMETER(buf); UNUSED_PARAMETER(len); UNUSED_PARAMETER(pos); -EPERM; }) +#endif int kernel_read_compat(struct file *file, loff_t offset, char *addr, unsigned long count); #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) */ #define kernel_read_compat(file, offset, addr, count) kernel_read(file, offset, addr, count) diff --git a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/linux_osl.c b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/linux_osl.c index af52d836bf9f..621d3dae5dbc 100755 --- a/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/linux_osl.c +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/linux_osl.c @@ -1939,6 +1939,8 @@ osl_timer_del(osl_t *osh, osl_timer_t *t) int kernel_read_compat(struct file *file, loff_t offset, char *addr, unsigned long count) { + if (!IS_ENABLED(CONFIG_NO_GKI)) + return -EPERM; return (int)kernel_read(file, addr, (size_t)count, &offset); } #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)) */