diff options
Diffstat (limited to 'drivers/mtd/ubi/io.c')
-rw-r--r-- | drivers/mtd/ubi/io.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 7c304eec78b5..db3efdef2433 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c | |||
@@ -173,6 +173,16 @@ retry: | |||
173 | ubi_err("error %d while reading %d bytes from PEB %d:%d, " | 173 | ubi_err("error %d while reading %d bytes from PEB %d:%d, " |
174 | "read %zd bytes", err, len, pnum, offset, read); | 174 | "read %zd bytes", err, len, pnum, offset, read); |
175 | ubi_dbg_dump_stack(); | 175 | ubi_dbg_dump_stack(); |
176 | |||
177 | /* | ||
178 | * The driver should never return -EBADMSG if it failed to read | ||
179 | * all the requested data. But some buggy drivers might do | ||
180 | * this, so we change it to -EIO. | ||
181 | */ | ||
182 | if (read != len && err == -EBADMSG) { | ||
183 | ubi_assert(0); | ||
184 | err = -EIO; | ||
185 | } | ||
176 | } else { | 186 | } else { |
177 | ubi_assert(len == read); | 187 | ubi_assert(len == read); |
178 | 188 | ||