Skip to content

Commit

Permalink
staging: comedi: Fix reversed test in comedi_device_attach()
Browse files Browse the repository at this point in the history
Commit 3902a37 (staging: comedi:
refactor comedi_device_attach() a bit) by yours truly introduced an
inverted logic bug in comedi_device_attach() for the case where the
driver expects the device to be configured by driver name rather than
board name.  The result of a strcmp() is being tested incorrectly.  Fix
it.

Thanks to Stephen N Chivers for discovering the bug and suggesting the
fix.

Cc: <stable@vger.kernel.org> # 3.5.x
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Aug 14, 2012
1 parent a26f4dd commit 80eb7a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_ptr = comedi_recognize(driv, it->board_name);
if (dev->board_ptr)
break;
} else if (strcmp(driv->driver_name, it->board_name))
} else if (strcmp(driv->driver_name, it->board_name) == 0)
break;
module_put(driv->module);
}
Expand Down

0 comments on commit 80eb7a5

Please sign in to comment.