Skip to content
Snippets Groups Projects
Commit 0827dd21 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra Committed by Alessandro Rubini
Browse files

pcie-wb: Handle potential minor number overflow.

parent 119b3c8e
Branches
Tags
No related merge requests found
......@@ -334,7 +334,7 @@ int wishbone_register(struct wishbone* wb)
break;
} else {
/* Run out of minors? */
if (MINOR(dev) - MINOR(wishbone_dev_first) == max_devices) goto fail_out;
if (MINOR(dev) - MINOR(wishbone_dev_first) == max_devices-1) goto fail_out;
/* Try the next minor */
dev = MKDEV(MAJOR(dev), MINOR(dev) + 1);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment