From 042c22375251bce5736953da127f6ff4db25c955 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Mon, 12 Dec 2005 01:56:52 +0000 Subject: [PATCH] Fixed null dereference in attach. --- comedi/drivers/ni_pcimio.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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) -- 2.26.2