summaryrefslogtreecommitdiffstats
path: root/fs/char_dev.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--fs/char_dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c
index 5fffd5050..2c3d519b2 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -553,7 +553,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;