[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ppc/pnv: Fix check on block device before updating drive con
From: |
David Gibson |
Subject: |
Re: [PATCH] ppc/pnv: Fix check on block device before updating drive contents |
Date: |
Wed, 3 Nov 2021 11:11:15 +1100 |
On Tue, Nov 02, 2021 at 05:29:05PM +0100, Cédric Le Goater wrote:
> Test is wrong and the backend can never updated. It could have led to
> a QEMU crash but since the firmware deactivates flash access if a valid
> layout is not detected, it went unnoticed.
>
> Reported-by: Coverity CID 1465223
> Fixes: 35dde5766211 ("ppc/pnv: Add a PNOR model")
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Applied to ppc-for-6.2, thanks.
> ---
> hw/ppc/pnv_pnor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/ppc/pnv_pnor.c b/hw/ppc/pnv_pnor.c
> index 5ef1cf2afbe1..83ecccca28df 100644
> --- a/hw/ppc/pnv_pnor.c
> +++ b/hw/ppc/pnv_pnor.c
> @@ -36,7 +36,7 @@ static void pnv_pnor_update(PnvPnor *s, int offset, int
> size)
> int offset_end;
> int ret;
>
> - if (s->blk) {
> + if (!s->blk || !blk_is_writable(s->blk)) {
> return;
> }
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature