Skip to content

Commit

Permalink
drivers: uio: Fix UIO device registration failure
Browse files Browse the repository at this point in the history
Until recently uio_get_minor() returned 0 for success and
a negative value on failure.  This became non-negative for suceess and
negative for failure.  Restore the original return value spec so that we can
successfully initialize UIO devices with a non-zero minor device
number.

Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
dhobsong authored and gregkh committed Mar 29, 2013
1 parent 7f4f230 commit 5ed0505
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/uio/uio.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ static int uio_get_minor(struct uio_device *idev)
retval = idr_alloc(&uio_idr, idev, 0, UIO_MAX_DEVICES, GFP_KERNEL);
if (retval >= 0) {
idev->minor = retval;
retval = 0;
} else if (retval == -ENOSPC) {
dev_err(idev->dev, "too many uio devices\n");
retval = -EINVAL;
Expand Down

0 comments on commit 5ed0505

Please sign in to comment.