lkml.org 
[lkml]   [2004]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: baycom_par dereference before check.
Dave Jones wrote:
> On Fri, Apr 16, 2004 at 05:48:57PM -0400, Jeff Garzik wrote:
>
> > >Good point. Still doesn't strike me as particularly nice though.
> > I would rather just remove the checks completely. The success of any of
> > those checks is a BUG() condition that should never occur.
>
> That works for me too. How about this?
>
> Dave
>
> --- linux-2.6.5/drivers/net/hamradio/baycom_par.c~ 2004-04-16 22:52:35.000000000 +0100
> +++ linux-2.6.5/drivers/net/hamradio/baycom_par.c 2004-04-16 22:52:53.000000000 +0100
> @@ -274,8 +274,8 @@
> struct net_device *dev = (struct net_device *)dev_id;
> struct baycom_state *bc = netdev_priv(dev);
>
> - if (!dev || !bc || bc->hdrv.magic != HDLCDRV_MAGIC)
> - return;
> + BUG_ON(!bc);
> + BUG_ON(bc->hdrv.magic != HDLCDRV_MAGIC);


I applied a patch which simplied removed the checks.

Jeff



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.067 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site