From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] block: do not BUG() on failed block_get
Date: Wed, 30 May 2012 07:31:15 +0200 [thread overview]
Message-ID: <1338355875-18830-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1338355875-18830-1-git-send-email-s.hauer@pengutronix.de>
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>
---
common/block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/block.c b/common/block.c
index 437dc95..5983171 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);
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-05-30 5:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-30 5:31 [PATCH 1/2] block: propagate error code from block_get Sascha Hauer
2012-05-30 5:31 ` Sascha Hauer [this message]
2012-05-31 12:46 ` [PATCH 2/2] block: do not BUG() on failed block_get Roberto Nibali
2012-05-31 12:45 ` [PATCH 1/2] block: propagate error code from block_get Roberto Nibali
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=1338355875-18830-2-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@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