From 416453cadc3a40036d625c6f798151b4b970f8d6 Mon Sep 17 00:00:00 2001 From: Magnus Bergmark Date: Tue, 18 Aug 2015 21:10:30 +0200 Subject: [PATCH] No more NULL dereference and kernel panic on current kernels Found patch on the web: http://users.telenet.be/x86_64/Patches/rtl8192eu-k3.13.patch Before patch, kernel panic due to a NULL dereference in rtw_ndev_notifier_register; this patch solves that problem by not using these methods on kernel versions after a certain number, so it leads me to believe that this patch is meant to make the driver compatible with newer kernel versions. --- include/osdep_intf.h | 2 ++ os_dep/linux/os_intfs.c | 13 ++++++++++--- os_dep/linux/rtw_android.c | 2 +- os_dep/linux/rtw_proc.c | 2 +- os_dep/linux/usb_intf.c | 7 ++++++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/include/osdep_intf.h b/include/osdep_intf.h index 7a61a13..48bada5 100644 --- a/include/osdep_intf.h +++ b/include/osdep_intf.h @@ -116,8 +116,10 @@ void rtw_unregister_netdevs(struct dvobj_priv *dvobj); u16 rtw_recv_select_queue(struct sk_buff *skb); #endif //LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35) +#if (LINUX_VERSION_CODE> 5; } -static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb) +static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb +#if (LINUX_VERSION_CODE>=KERNEL_VERSION(3, 13, 0)) + ,void *accel_priv +#endif +#if (LINUX_VERSION_CODE>=KERNEL_VERSION(3, 14, 0)) + ,select_queue_fallback_t fallback +#endif +) { _adapter *padapter = rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -643,9 +650,9 @@ u16 rtw_recv_select_queue(struct sk_buff *skb) return rtw_1d_to_queue[priority]; } - #endif +#if (LINUX_VERSION_CODE