A NULL pointer error during sdio remove has been resolved in the Linux kernel. When running 'rmmod ath10k', ath10k sdio remove() will free sdio workqueue by destroy workqueue(). However, if CONFIG INIT ON FREE DEFAULT ON is set to yes, a kernel panic will happen due to the NULL pointer error. The issue occurs because ath10k sdio remove() calls ath10k core destroy() before destroy workqueue(), which frees the struct cfg80211 registered device *rdev and its members, including the pointer of sdio workqueue. To fix this, destroy workqueue() should be called before ath10k core destroy(). The affected device is QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00189.