[PATCH] Catch errors when mounting invalid cramfs partitions.

Owen Kirby osk at exegin.com
Wed May 7 14:04:14 PDT 2014


>From be93e50aafc81d7978a100234e9b3c380e5c65da Mon Sep 17 00:00:00 2001
From: Owen Kirby <osk at exegin.com>
Date: Wed, 7 May 2014 12:29:39 -0700
Subject: [PATCH]   Catch errors when mounting invalid cramfs partitions.

When barebox is attempting to mount a cramfs partition with a bad magic, the
device will report success, but becomes unresponsive when trying to do any
file operations. The problem is caused by a missed error in cramfs_probe().

Signed-off-by: Owen Kirby <osk at exegin.com>
---
 fs/cramfs/cramfs.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c
index 8218fcf..75ff797 100644
--- a/fs/cramfs/cramfs.c
+++ b/fs/cramfs/cramfs.c
@@ -438,6 +438,7 @@ static int cramfs_probe(struct device_d *dev)
 	if (cramfs_read_super(priv)) {
 		dev_info(dev, "no valid cramfs found\n");
 		ret =  -EINVAL;
+		goto err_out;
 	}
 
 	priv->curr_base = -1;
-- 
1.7.9.5





More information about the barebox mailing list