prevent init_timer from accessing a NULL pointer

This commit is contained in:
morrownr 2021-12-22 10:53:05 -06:00
parent 4d9b26dd04
commit 4f76bfe799

View File

@ -1201,7 +1201,7 @@ void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc, void *ctx)
_adapter *adapter = (_adapter *)padapter;
#ifdef PLATFORM_LINUX
_init_timer(ptimer, adapter->pnetdev, pfunc, ctx);
_init_timer(ptimer, adapter ? adapter->pnetdev : NULL, pfunc, ctx);
#endif
#ifdef PLATFORM_FREEBSD
_init_timer(ptimer, adapter->pifp, pfunc, ctx);