When calling squashfs_mount() s_op needs to be set already, otherwise
calling alloc_inode() yields in a NULL pointer derefence.

Signed-off-by: Sascha Hauer <[email protected]>
---
 fs/squashfs/squashfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/squashfs/squashfs.c b/fs/squashfs/squashfs.c
index 69451f7b84..be03618b2f 100644
--- a/fs/squashfs/squashfs.c
+++ b/fs/squashfs/squashfs.c
@@ -101,6 +101,7 @@ static int squashfs_probe(struct device_d *dev)
        if (ret)
                goto err_out;
 
+       sb->s_op = &squashfs_super_ops;
 
        ret = squashfs_mount(fsdev, 0);
        if (ret) {
@@ -110,8 +111,6 @@ static int squashfs_probe(struct device_d *dev)
 
        squashfs_set_rootarg(fsdev);
 
-       sb->s_op = &squashfs_super_ops;
-
        return 0;
 
 err_out:
-- 
2.28.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to