From: Frank Mori Hess Date: Mon, 12 Dec 2005 01:56:52 +0000 (+0000) Subject: Fixed null dereference in attach. X-Git-Tag: r0_7_71~105 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=042c22375251bce5736953da127f6ff4db25c955;p=comedi.git Fixed null dereference in attach. --- diff --git a/comedi/drivers/ni_pcimio.c b/comedi/drivers/ni_pcimio.c index feedd283..bcfb3881 100644 --- a/comedi/drivers/ni_pcimio.c +++ b/comedi/drivers/ni_pcimio.c @@ -893,6 +893,13 @@ static int pcimio_attach(comedi_device *dev,comedi_devconfig *it) ret=ni_alloc_private(dev); if(ret<0)return ret; + + ret=pcimio_find_device(dev,it->options[0],it->options[1]); + if(ret<0)return ret; + + printk(" %s",boardtype.name); + dev->board_name=boardtype.name; + if(boardtype.reg_type == ni_reg_m_series) { devpriv->stc_writew = &m_series_stc_writew; @@ -904,11 +911,6 @@ static int pcimio_attach(comedi_device *dev,comedi_devconfig *it) devpriv->stc_readw = &e_series_win_in; devpriv->stc_writel = &win_out2; } - ret=pcimio_find_device(dev,it->options[0],it->options[1]); - if(ret<0)return ret; - - printk(" %s",boardtype.name); - dev->board_name=boardtype.name; ret = mite_setup(devpriv->mite); if(ret < 0)