On Wed, Oct 05, 2011 at 12:08:36PM -0700, Bing Zhao wrote: > Since the first element of priv[] cannot be NULL. How about this fix? > > + priv = adapter->priv[0]; > + BUG_ON(!priv); > + > wiphy_unregister(priv->wdev->wiphy); > I don't know the code at all, so I'll trust you on that. :) But please don't add the BUG_ON(). Calls to BUG_ON() make the code messier, and they are more painful than needed for the user. If we don't have the BUG_ON() then we get an Oops and the driver will die, but we can still can close our documents and reboot the system. Debugging NULL dereference bugs is normally super easy. Just compile with CONFIG_DEBUG_INFO=y, run gdb on the .ko file and type: "list *(function_name+0x63)" at the gdb prompt. Done. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html