lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 16 Sep 2017 14:20:21 +0200
From:   Christian König <ckoenig.leichtzumerken@...il.com>
To:     Arnd Bergmann <arnd@...db.de>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        David Airlie <airlied@...ux.ie>
Cc:     dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/radeon: properly initialize r600_audio_status() data

Am 15.09.2017 um 22:06 schrieb Arnd Bergmann:
> The structure returned from r600_audio_status() is only partially
> initialized, and older gcc versions (4.3 and 4.4) warn about this:
>
> drivers/gpu/drm/radeon/r600_hdmi.c: In function 'r600_audio_status':
> drivers/gpu/drm/radeon/r600_hdmi.c:108: error: 'status.id' is used uninitialized in this function
> drivers/gpu/drm/radeon/r600_hdmi.c:108: error: 'status.connected' is used uninitialized in this function
> drivers/gpu/drm/radeon/r600_hdmi.c:108: error: 'status.offset' is used uninitialized in this function
>
> This is harmless and surprisingly correct in C99, as the caller
> only accesses the fields that got initialized, so newer compilers
> don't warn about it, but initializing the entire structure feels
> like the right thing to do here and avoids the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Reviewed-by: Christian König <christian.koenig@....com>

> ---
>   drivers/gpu/drm/radeon/r600_hdmi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c
> index e82a99cb2459..ab32830c4e23 100644
> --- a/drivers/gpu/drm/radeon/r600_hdmi.c
> +++ b/drivers/gpu/drm/radeon/r600_hdmi.c
> @@ -58,7 +58,7 @@ enum r600_hdmi_iec_status_bits {
>   
>   static struct r600_audio_pin r600_audio_status(struct radeon_device *rdev)
>   {
> -	struct r600_audio_pin status;
> +	struct r600_audio_pin status = {};
>   	uint32_t value;
>   
>   	value = RREG32(R600_AUDIO_RATE_BPS_CHANNEL);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ