[PATCH 2/2] block: do not BUG() on failed block_get
Roberto Nibali
rnibali at gmail.com
Thu May 31 08:46:24 EDT 2012
Hi
On Wed, May 30, 2012 at 7:31 AM, Sascha Hauer <s.hauer at pengutronix.de>wrote:
> 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 at 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
>
>
Tested-by: Roberto Nibali <rnibali at gmail.com>
Acked-by: Roberto Nibali <rnibali at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20120531/71e7e501/attachment.html>
More information about the barebox
mailing list