mm: fix dereferencing possible ERR_PTR
[linux-block.git] / mm / secretmem.c
index e3e9590c6fb30e41e5c54a31d896e92a05077a9a..3f715409979588ee58374cb14a464d4b6c26280e 100644 (file)
@@ -285,7 +285,7 @@ static int secretmem_init(void)
 
        secretmem_mnt = kern_mount(&secretmem_fs);
        if (IS_ERR(secretmem_mnt))
-               ret = PTR_ERR(secretmem_mnt);
+               return PTR_ERR(secretmem_mnt);
 
        /* prevent secretmem mappings from ever getting PROT_EXEC */
        secretmem_mnt->mnt_flags |= MNT_NOEXEC;