[FIX] use d_path between path_get()/path_put() 90/48690/1
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 24 Sep 2015 18:47:57 +0000 (21:47 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 24 Sep 2015 18:47:57 +0000 (21:47 +0300)
Change-Id: I608bca68742aacdba4456f772cb2e006fc65b72c
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
ks_features/file_ops.c
parser/usm_msg.c

index 8845a74..5769e3c 100644 (file)
@@ -347,7 +347,11 @@ static int fops_fcheck(struct task_struct *task, struct file *file)
 
 static char *fops_fpath(struct file *file, char *buf, int buflen)
 {
-       char *filename = d_path(&file->f_path, buf, buflen);
+       char *filename;
+
+       path_get(&file->f_path);
+       filename = d_path(&file->f_path, buf, buflen);
+       path_put(&file->f_path);
 
        if (IS_ERR_OR_NULL(filename)) {
                printk(FOPS_PREFIX "d_path FAILED: %ld\n", PTR_ERR(filename));
index 041d92e..3fcd733 100644 (file)
@@ -106,7 +106,10 @@ static int pack_path(void *data, size_t size, struct file *file)
                goto cp2buf;
        }
 
+       path_get(&file->f_path);
        filename = d_path(&file->f_path, tmp_buf, TMP_BUF_LEN);
+       path_put(&file->f_path);
+
        if (IS_ERR_OR_NULL(filename)) {
                filename = NA;
                goto cp2buf;