[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 1/1] block: fix shadowed variable in bdrv_co_
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [PATCH v2 1/1] block: fix shadowed variable in bdrv_co_pdiscard |
Date: |
Mon, 10 Jul 2017 10:32:05 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/10/2017 10:05 AM, Denis V. Lunev wrote:
> We've had a shadowed 'ret' variable, which risks returning the wrong
> value, introduced in commit b9c64947.
>
> Signed-off-by: Denis V. Lunev <address@hidden>
> Reviewed-by: Fam Zheng <address@hidden>
> CC: Stefan Hajnoczi <address@hidden>
> CC: Kevin Wolf <address@hidden>
> CC: Eric Blake <address@hidden>
> ---
> block/io.c | 1 -
> 1 file changed, 1 deletion(-)
>
Reviewed-by: Eric Blake <address@hidden>
> diff --git a/block/io.c b/block/io.c
> index 23170a57ee..87208990c4 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -2327,7 +2327,6 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs,
> int64_t offset,
> assert(max_pdiscard >= bs->bl.request_alignment);
>
> while (bytes > 0) {
> - int ret;
> int num = bytes;
>
> if (head) {
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature