瀏覽代碼

Blackfin arch: handle case of d_path() returning error in decode_address()

d_path() can return an error.  Most of its callers do something or other to
make up something sane in that case.  Do similar for blackfin's
decode_address() call to d_path().

Signed-off-by: Tim Pepper <lnxninja@linux.vnet.ibm.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Tim Pepper 16 年之前
父節點
當前提交
6a0bfff44e
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      arch/blackfin/kernel/traps.c

+ 5 - 2
arch/blackfin/kernel/traps.c

@@ -147,9 +147,12 @@ static void decode_address(char *buf, unsigned long address)
 				char *name = p->comm;
 				struct file *file = vma->vm_file;
 
-				if (file)
-					name = d_path(&file->f_path, _tmpbuf,
+				if (file) {
+					char *d_name = d_path(&file->f_path, _tmpbuf,
 						      sizeof(_tmpbuf));
+					if (!IS_ERR(d_name))
+						name = d_name;
+				}
 
 				/* FLAT does not have its text aligned to the start of
 				 * the map while FDPIC ELF does ...