@@ -781,6 +781,7 @@ void drbd_debugfs_device_add(struct drbd_device *device)
snprintf(vnr_buf, sizeof(vnr_buf), "%u", device->vnr);
dentry = debugfs_create_dir(vnr_buf, vols_dir);
+ if (IS_ERR(dentry)) goto fail;
device->debugfs_vol = dentry;
snprintf(minor_buf, sizeof(minor_buf), "%u", device->minor);
@@ -789,9 +790,12 @@ void drbd_debugfs_device_add(struct drbd_device *device)
if (!slink_name)
goto fail;
dentry = debugfs_create_symlink(minor_buf, drbd_debugfs_minors, slink_name);
+ if (!IS_ERR(dentry)) {
device->debugfs_minor = dentry;
kfree(slink_name);
slink_name = NULL;
+ } else
+ goto fail;
#define DCF(name) do { \
dentry = debugfs_create_file(#name, 0440, \