See earlier patch.
> --- linux/drivers/char/misc.c.0 Fri Mar 2 09:35:01 2001
> +++ linux/drivers/char/misc.c Fri Mar 2 10:01:17 2001
> @@ -175,14 +175,16 @@
>
> if (misc->next || misc->prev)
> return -EBUSY;
> +
> down(&misc_sem);
> - c = misc_list.next;
>
> - while ((c != &misc_list) && (c->minor != misc->minor))
> + c = misc_list.next;
> + while (c != &misc_list) {
> + if (c->minor == misc->minor) {
> + up(&misc_sem);
> + return -EBUSY;
> + }
> c = c->next;
> - if (c == &misc_list) {
> - up(&misc_sem);
> - return -EBUSY;
> }
>
> if (misc->minor == MISC_DYNAMIC_MINOR) {
This is fine as well, and possibly more readable.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/