Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chardev: set variable ret to -EBUSY before checking minor range overlap
When allocating dynamic major, the minor range overlap check in __register_chrdev_region() will not fail, so actually there is no real case to passing non negative error code to caller. However, set variable ret to -EBUSY before checking minor range overlap will avoid false-positive warning from code analyzing tool(like Smatch) and also make the code more easy to understand. Suggested-by: Dan Carpenter <[email protected]> Signed-off-by: Chengguang Xu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information