diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-06-18 05:06:30 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-07-18 09:55:55 -0400 |
commit | 94784d916458d51043ba76849b9beaf330baef2f (patch) | |
tree | a7b71f0aa61ce5524dc602716c6ae722ff78d461 /drivers/mtd/ubi/debug.c | |
parent | 7753f1692f53d82b4cc08084462b0fd2803c1f04 (diff) |
UBI: bugfix in error path
When volume creation fails, we have to set ubi->volumes[vol_id]
back to NULL.
This patch also tweaks some debugging stuff.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/debug.c')
-rw-r--r-- | drivers/mtd/ubi/debug.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c index 9a996c5280f9..310341e5cd43 100644 --- a/drivers/mtd/ubi/debug.c +++ b/drivers/mtd/ubi/debug.c | |||
@@ -91,7 +91,7 @@ void ubi_dbg_dump_vol_info(const struct ubi_volume *vol) | |||
91 | 91 | ||
92 | if (vol->name_len <= UBI_VOL_NAME_MAX && | 92 | if (vol->name_len <= UBI_VOL_NAME_MAX && |
93 | strnlen(vol->name, vol->name_len + 1) == vol->name_len) { | 93 | strnlen(vol->name, vol->name_len + 1) == vol->name_len) { |
94 | dbg_msg("name %s", vol->name); | 94 | dbg_msg("name %s", vol->name); |
95 | } else { | 95 | } else { |
96 | dbg_msg("the 1st 5 characters of the name: %c%c%c%c%c", | 96 | dbg_msg("the 1st 5 characters of the name: %c%c%c%c%c", |
97 | vol->name[0], vol->name[1], vol->name[2], | 97 | vol->name[0], vol->name[1], vol->name[2], |
@@ -117,13 +117,13 @@ void ubi_dbg_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx) | |||
117 | dbg_msg("name_len %d", name_len); | 117 | dbg_msg("name_len %d", name_len); |
118 | 118 | ||
119 | if (r->name[0] == '\0') { | 119 | if (r->name[0] == '\0') { |
120 | dbg_msg("name NULL"); | 120 | dbg_msg("name NULL"); |
121 | return; | 121 | return; |
122 | } | 122 | } |
123 | 123 | ||
124 | if (name_len <= UBI_VOL_NAME_MAX && | 124 | if (name_len <= UBI_VOL_NAME_MAX && |
125 | strnlen(&r->name[0], name_len + 1) == name_len) { | 125 | strnlen(&r->name[0], name_len + 1) == name_len) { |
126 | dbg_msg("name %s", &r->name[0]); | 126 | dbg_msg("name %s", &r->name[0]); |
127 | } else { | 127 | } else { |
128 | dbg_msg("1st 5 characters of the name: %c%c%c%c%c", | 128 | dbg_msg("1st 5 characters of the name: %c%c%c%c%c", |
129 | r->name[0], r->name[1], r->name[2], r->name[3], | 129 | r->name[0], r->name[1], r->name[2], r->name[3], |