diff --git a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c index 973f544e85e1..76bf5619fdd5 100644 --- a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c +++ b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c @@ -58,7 +58,7 @@ struct comedi_device *comedi_open(const char *filename) retval = NULL; up_read(&dev->attach_lock); - if (retval == NULL) + if (!retval) comedi_dev_put(dev); return retval;