diff options
-rw-r--r-- | fs/char_dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c index 340e4543b24a..13deb45f1ec6 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c @@ -554,7 +554,7 @@ int cdev_device_add(struct cdev *cdev, struct device *dev) } rc = device_add(dev); - if (rc) + if (rc && dev->devt) cdev_del(cdev); return rc; |