From ff331f7d9089a1917bf21d41110b0b182e74c766 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 24 Oct 2012 16:28:36 -0700 Subject: [PATCH] staging: comedi: cb_pcidda: fix error test in cb_pcidda_attach_pci() As pointed out by Fengguang Wu, the error test after finding the boardinfo should be testing for (!thisboard). Signed-off-by: H Hartley Sweeten Reported-by: Fengguang Wu Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/cb_pcidda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/cb_pcidda.c b/drivers/staging/comedi/drivers/cb_pcidda.c index 798374fe8da..06e546f3fdb 100644 --- a/drivers/staging/comedi/drivers/cb_pcidda.c +++ b/drivers/staging/comedi/drivers/cb_pcidda.c @@ -657,7 +657,7 @@ static int cb_pcidda_attach_pci(struct comedi_device *dev, int ret; thisboard = cb_pcidda_find_boardinfo(dev, pcidev); - if (!pcidev) + if (!thisboard) return -ENODEV; dev->board_ptr = thisboard; dev->board_name = thisboard->name; -- 2.20.1