Skip to contentSkip to conversation

mm/secretmem: remove redundant initiialization of pointer file

PATCH Applied Colin Ian King 2 participants 2 messages Jan 16, 2023 – Jan 19, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/secretmem: remove redundant initiialization of pointer file

The pointer file is being initialized with a value that is never read, it is being re-assigned later on. Clean up code by removing the redundant initialization.

---
 mm/secretmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/secretmem.c +1 -1
index 04c3ac9448a1..be3fff86ba00 100644
@@ -190,7 +190,7 @@ static struct vfsmount *secretmem_mnt;
 
 static struct file *secretmem_file_create(unsigned long flags)
 {
-	struct file *file = ERR_PTR(-ENOMEM);
+	struct file *file;
 	struct inode *inode;
 	const char *anon_name = "[secretmem]";
 	const struct qstr qname = QSTR_INIT(anon_name, strlen(anon_name));
Signature · 1 line
2.30.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Colin Ian King

The pointer file is being initialized with a value that is never read, it is being re-assigned later on. Clean up code by removing the redundant initialization.

Quoted 21 lines
---
 mm/secretmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/secretmem.c +1 -1
index 04c3ac9448a1..be3fff86ba00 100644
@@ -190,7 +190,7 @@ static struct vfsmount *secretmem_mnt;
 
 static struct file *secretmem_file_create(unsigned long flags)
 {
-	struct file *file = ERR_PTR(-ENOMEM);
+	struct file *file;
 	struct inode *inode;
 	const char *anon_name = "[secretmem]";
 	const struct qstr qname = QSTR_INIT(anon_name, strlen(anon_name));
Signature · 1 line
2.30.2
Signature · 2 lines
Sincerely yours,
Mike.