Search Linux Wireless

RE: mwifiex: add cfg80211 handlers add/del_virtual_intf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx]
> Sent: Wednesday, October 05, 2011 12:52 PM
> To: Bing Zhao
> Cc: Yogesh Powar; linux-wireless@xxxxxxxxxxxxxxx
> Subject: Re: mwifiex: add cfg80211 handlers add/del_virtual_intf
> 
> 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.

Thanks for the information.

Regards,
Bing

> 
> 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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux