Whamcloud - gitweb
b=23293 Fix memory leak in lprocfs_fops_read().
[fs/lustre-release.git] / lustre / obdclass / lprocfs_status.c
index e134215..a253894 100644 (file)
@@ -185,8 +185,10 @@ static ssize_t lprocfs_fops_read(struct file *f, char __user *buf,
         if (page == NULL)
                 return -ENOMEM;
 
-        if (LPROCFS_ENTRY_AND_CHECK(dp))
-                return -ENOENT;
+        if (LPROCFS_ENTRY_AND_CHECK(dp)) {
+                rc = -ENOENT;
+                goto out;
+        }
 
         OBD_FAIL_TIMEOUT(OBD_FAIL_LPROC_REMOVE, 10);
         if (dp->read_proc)
@@ -2305,6 +2307,19 @@ int lprocfs_obd_wr_recovery_time_hard(struct file *file, const char *buffer,
 }
 EXPORT_SYMBOL(lprocfs_obd_wr_recovery_time_hard);
 
+int lprocfs_obd_rd_mntdev(char *page, char **start, off_t off,
+                          int count, int *eof, void *data)
+{
+        struct obd_device *obd = (struct obd_device *)data;
+
+        LASSERT(obd != NULL);
+        LASSERT(obd->u.obt.obt_vfsmnt->mnt_devname);
+        *eof = 1;
+        return snprintf(page, count, "%s\n",
+                        obd->u.obt.obt_vfsmnt->mnt_devname);
+}
+EXPORT_SYMBOL(lprocfs_obd_rd_mntdev);
+
 EXPORT_SYMBOL(lprocfs_register);
 EXPORT_SYMBOL(lprocfs_srch);
 EXPORT_SYMBOL(lprocfs_remove);