Skip to contentSkip to conversation

vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp

PATCH New Konstantin Khlebnikov 1 participant 1 message Jul 17, 2011 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp

Replace unclear (struct dentry *) to (struct file *) typecast with ERR_CAST() macro.

---
 fs/open.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/open.c +1 -1
index b52cf01..739b751 100644
@@ -793,7 +793,7 @@ out:
 	return nd->intent.open.file;
 out_err:
 	release_open_intent(nd);
-	nd->intent.open.file = (struct file *)dentry;
+	nd->intent.open.file = ERR_CAST(dentry);
 	goto out;
 }
 EXPORT_SYMBOL_GPL(lookup_instantiate_filp);