Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6bdb6101 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Greg Kroah-Hartman
Browse files

staging: unisys: unregister chardev on error



after registering the major numbers if the cdev_add fails then we were
not releasing the major numbers. now we are doing that.

Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 61c507cf
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -65,8 +65,10 @@ visorchipset_file_init(dev_t major_dev, struct visorchannel **controlvm_channel)
			return -1;
			return -1;
	}
	}
	rc = cdev_add(&file_cdev, MKDEV(MAJOR(major_dev), 0), 1);
	rc = cdev_add(&file_cdev, MKDEV(MAJOR(major_dev), 0), 1);
	if (rc  < 0)
	if (rc < 0) {
		unregister_chrdev_region(major_dev, 1);
		return -1;
		return -1;
	}
	return 0;
	return 0;
}
}