Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RAW driver: Remove call to kobject_put().

If cdev_add() fails, there is no justification for subsequently
calling kobject_put().

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Robert P. J. Day and committed by
Greg Kroah-Hartman
9333744d b50fa7c8

-1
-1
drivers/char/raw.c
··· 339 339 cdev_init(&raw_cdev, &raw_fops); 340 340 ret = cdev_add(&raw_cdev, dev, max_raw_minors); 341 341 if (ret) { 342 - kobject_put(&raw_cdev.kobj); 343 342 goto error_region; 344 343 } 345 344