lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071120101333.GA3244@fluff.org.uk>
Date:	Tue, 20 Nov 2007 10:13:33 +0000
From:	Ben Dooks <ben@...ff.org>
To:	Christoph Hellwig <hch@...radead.org>
Cc:	Ben Dooks <ben-linux@...ff.org>, netdev@...r.kernel.org,
	vince@...tec.co.uk
Subject: Re: [patch 06/22] NET: DM9000: Use kthread to probe MII status
	when device open

On Tue, Nov 20, 2007 at 07:46:27AM +0000, Christoph Hellwig wrote:
> > +static void dm9000_start_thread(struct net_device *dev)
> > +{
> > +	board_info_t *db = (board_info_t *) dev->priv;
> > +
> > +	/* Create a thread to keep track of the state of the phy
> > +	 * as we do not get an interrupt when the PHY state changes.
> > +	 *
> > +	 * Note, we do not abort the open if we fail to create the
> > +	 * thread, as this is mainly to ensure the user is kept up to
> > +	 * date with the device's state. PHY accesses will still work
> > +	 * via the MII read and write methods.
> > +	 */
> > +
> > +	db->thread = kthread_create(dm9000_mii_thread, db, dev->name);
> > +	if (IS_ERR(db->thread)) {
> > +		dev_err(db->dev, "failed to create MII thread\n");
> > +		db->thread = NULL;
> > +	} else
> > +		wake_up_process(db->thread);
> > +}
> > +
> >  /*
> >   *  Open the interface.
> >   *  The interface is opened whenever "ifconfig" actives it.
> > @@ -704,12 +724,7 @@ dm9000_open(struct net_device *dev)
> >  	/* Init driver variable */
> >  	db->dbug_cnt = 0;
> >  
> > -	/* set and active a timer process */
> > -	init_timer(&db->timer);
> > -	db->timer.expires  = DM9000_TIMER_WUT;
> > -	db->timer.data     = (unsigned long) dev;
> > -	db->timer.function = &dm9000_timer;
> > -	add_timer(&db->timer);
> > +	dm9000_start_thread(dev);
> 
> Please don't just ignore the error.  Just inline the content of
> dm9000_start_thread into the caller and use proper goto-based
> unwinding.

The error is not important, I would be happy with adding an
error print in there, but not having the MII system print
an message if the link status changes is not an driver threatening
error.

-- 
Ben (ben@...ff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ