[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/8] smbus: Fix unreachable code in smb_transact
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 6/8] smbus: Fix unreachable code in smb_transaction() |
Date: |
Wed, 28 May 2014 06:59:21 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 05/26/2014 07:40 PM, address@hidden wrote:
> From: Gonglei <address@hidden>
>
> Spotted by Coverity:
>
> (1) Event unreachable: This code cannot be reached: "abort();".
>
> 112 abort();
>
> Signed-off-by: Gonglei <address@hidden>
> ---
> hw/i2c/pm_smbus.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/hw/i2c/pm_smbus.c b/hw/i2c/pm_smbus.c
> index fedb5fb..da09eb0 100644
> --- a/hw/i2c/pm_smbus.c
> +++ b/hw/i2c/pm_smbus.c
> @@ -109,7 +109,6 @@ static void smb_transaction(PMSMBus *s)
> default:
> goto error;
> }
> - abort();
Given the questions that have been raised on this being dead code, would
it be worth just getting rid of the 'default' label, as in:
switch () {
existing normal cases
}
goto error;
so that you are trading the abort() with an unconditional goto that gets
reached via the fact that the switch no longer has a default?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 3/8] json-parser: fix two coverity defects, (continued)
Re: [Qemu-devel] [PATCH 6/8] smbus: Fix unreachable code in smb_transaction(),
Eric Blake <=
[Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}, arei.gonglei, 2014/05/26
- Re: [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}, Paolo Bonzini, 2014/05/27
- Re: [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}, Gonglei (Arei), 2014/05/28
- Re: [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}, Paolo Bonzini, 2014/05/28
- Re: [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}, Gonglei (Arei), 2014/05/28
[Qemu-devel] [PATCH 8/8] audio: Fix using freed pointer in wav_fini_out(), arei.gonglei, 2014/05/26
[Qemu-devel] [PATCH 4/8] qcow2-cluster: Fix memory leak in copy_sectors, arei.gonglei, 2014/05/26