mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/3] fs: squashfs: set s_op in time
Date: Mon, 10 Aug 2020 13:12:10 +0200	[thread overview]
Message-ID: <20200810111212.31286-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20200810111212.31286-1-s.hauer@pengutronix.de>

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 <s.hauer@pengutronix.de>
---
 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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-08-10 11:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10 11:12 [PATCH 0/3] squashfs: Fix current master Sascha Hauer
2020-08-10 11:12 ` Sascha Hauer [this message]
2020-08-10 11:12 ` [PATCH 2/3] fs: squashfs: Do not free root inode Sascha Hauer
2020-08-10 11:12 ` [PATCH 3/3] fs: Use iget_locked() rather than squashfs specific function Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200810111212.31286-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox