* yam driver null deref
@ 2004-04-16 21:25 Dave Jones
2004-04-16 21:49 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2004-04-16 21:25 UTC (permalink / raw)
To: jgarzik; +Cc: Linux Kernel
--- linux-2.6.5/drivers/net/hamradio/yam.c~ 2004-04-16 22:24:00.000000000 +0100
+++ linux-2.6.5/drivers/net/hamradio/yam.c 2004-04-16 22:24:32.000000000 +0100
@@ -919,9 +919,12 @@
static int yam_close(struct net_device *dev)
{
struct sk_buff *skb;
- struct yam_port *yp = (struct yam_port *) dev->priv;
+ struct yam_port *yp;
- if (!dev || !yp)
+ if (!dev)
+ return -EINVAL;
+ yp = dev->priv;
+ if (!yp)
return -EINVAL;
/*
* disable interrupts
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: yam driver null deref
2004-04-16 21:25 yam driver null deref Dave Jones
@ 2004-04-16 21:49 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2004-04-16 21:49 UTC (permalink / raw)
To: Dave Jones; +Cc: Linux Kernel
Dave Jones wrote:
> --- linux-2.6.5/drivers/net/hamradio/yam.c~ 2004-04-16 22:24:00.000000000 +0100
> +++ linux-2.6.5/drivers/net/hamradio/yam.c 2004-04-16 22:24:32.000000000 +0100
> @@ -919,9 +919,12 @@
> static int yam_close(struct net_device *dev)
> {
> struct sk_buff *skb;
> - struct yam_port *yp = (struct yam_port *) dev->priv;
> + struct yam_port *yp;
>
> - if (!dev || !yp)
> + if (!dev)
> + return -EINVAL;
> + yp = dev->priv;
> + if (!yp)
> return -EINVAL;
Ditto... dev will never be NULL here. And most likely not dev->priv
either.
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-16 21:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-16 21:25 yam driver null deref Dave Jones
2004-04-16 21:49 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox