mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 4/6] fs: return error pointer not NULL from cdev_mount_default
Date: Mon,  6 Jan 2025 10:18:33 +0100	[thread overview]
Message-ID: <20250106091835.3434836-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250106091835.3434836-1-a.fatoum@pengutronix.de>

cdev_mount_default is documented to return error pointers on errors and
that's what's done everywhere inside the function, except for errors
from the last call to cdev_get_mount_path.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 fs/fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fs.c b/fs/fs.c
index a9d2cc7088e3..6d047f197640 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1152,7 +1152,7 @@ const char *cdev_mount_default(struct cdev *cdev, const char *fsoptions)
 		return ERR_PTR(ret);
 	}
 
-	return cdev_get_mount_path(cdev);
+	return cdev_get_mount_path(cdev) ?: ERR_PTR(-ENODEV);
 }
 
 /*
-- 
2.39.5




  parent reply	other threads:[~2025-01-06  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-06  9:18 [PATCH 1/6] fs: ramfs: drop unneeded indirection during unlink Ahmad Fatoum
2025-01-06  9:18 ` [PATCH 2/6] fs: squashfs: delete unreferenced source file Ahmad Fatoum
2025-01-06  9:18 ` [PATCH 3/6] fs: collect legacy file system operation in new struct fs_legacy_ops Ahmad Fatoum
2025-01-06  9:18 ` Ahmad Fatoum [this message]
2025-01-06  9:18 ` [PATCH 5/6] commands: stat: fix size display for FILE_SIZE_STREAM Ahmad Fatoum
2025-01-06  9:18 ` [PATCH 6/6] commands: stat: print mode in octal if type unknown Ahmad Fatoum
2025-01-06 10:40 ` [PATCH 1/6] fs: ramfs: drop unneeded indirection during unlink 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=20250106091835.3434836-4-a.fatoum@pengutronix.de \
    --to=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