[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block/iscsi: fix uninitialized variable
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] block/iscsi: fix uninitialized variable |
Date: |
Tue, 23 Dec 2014 17:31:07 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 23/12/2014 16:30, Peter Wu wrote:
> 'ret' was never initialized in the success path.
>
> Signed-off-by: Peter Wu <address@hidden>
> ---
> Hi,
>
> Found this warning when compiling with --enable-debug. This issue was
> previously
> fixed as part of Peter Lieven's patch series[1] but it never seemed to get
> merged.
>
> Kinds regards,
> Peter
>
> [1]: https://lists.gnu.org/archive/html/qemu-devel/2014-03/msg04279.html
> ---
> block/iscsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/iscsi.c b/block/iscsi.c
> index ed375fc..12ddbfb 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -1286,7 +1286,7 @@ static int iscsi_open(BlockDriverState *bs, QDict
> *options, int flags,
> QemuOpts *opts;
> Error *local_err = NULL;
> const char *filename;
> - int i, ret;
> + int i, ret = 0;
>
> if ((BDRV_SECTOR_SIZE % 512) != 0) {
> error_setg(errp, "iSCSI: Invalid BDRV_SECTOR_SIZE. "
>
Thanks.
Paolo