summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-05-30 06:02:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-05-30 06:03:01 +0200
commitff6bacd6f4adeb5ec1eb90f299706c67e2e4fc99 (patch)
tree93bbca28f955246041b6e46fbe4e5bdcf1f8fdc5
parent949b03dfb16a48b873831e58f580dec14a91e679 (diff)
downloadbarebox-ff6bacd6f4adeb5ec1eb90f299706c67e2e4fc99.tar.gz
barebox-ff6bacd6f4adeb5ec1eb90f299706c67e2e4fc99.tar.xz
block: do not BUG() on failed block_get
It does not necessarily means a bug when block_get fails here, this can also be a failure on the underlying device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/block.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/block.c b/common/block.c
index 437dc95ce..598317163 100644
--- a/common/block.c
+++ b/common/block.c
@@ -245,7 +245,7 @@ static int block_put(struct block_device *blk, const void *buf, int block)
data = block_get(blk, block);
if (IS_ERR(data))
- BUG();
+ return PTR_ERR(data);
memcpy(data, buf, 1 << blk->blockbits);