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]
Message-ID: <CAD=FV=Xq6ZDgzzL9Y79hmtZxdogBkUwx=6NwQHM+8vt9PRL__A@mail.gmail.com>
Date:   Mon, 17 Jul 2017 13:44:28 -0700
From:   Doug Anderson <dianders@...omium.org>
To:     Sean Paul <seanpaul@...omium.org>
Cc:     Chris Zhong <zyw@...k-chips.com>,
        "open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>,
        Brian Norris <briannorris@...omium.org>,
        Mark Yao <mark.yao@...k-chips.com>,
        David Airlie <airlied@...ux.ie>,
        Heiko Stuebner <heiko@...ech.de>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/rockchip: cdn-dp: send audio infoframe to sink

Hi,

On Mon, Jul 17, 2017 at 1:23 PM, Sean Paul <seanpaul@...omium.org> wrote:
>> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
>> index 9b0b058..e59ca47 100644
>> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
>> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
>> @@ -802,6 +802,7 @@ static int cdn_dp_audio_hw_params(struct device *dev,  void *data,
>>               .sample_rate = params->sample_rate,
>>               .channels = params->channels,
>>       };
>> +     u8 buffer[14];
>
> Why 14?
>
> I think you should probably have buffer[HDMI_AUDIO_INFOFRAME_SIZE +
> SDP_HEADER_SIZE] so the reader knows how you arrived at this value.
>
>>       int ret;
>>
>>       mutex_lock(&dp->lock);
>> @@ -823,6 +824,25 @@ static int cdn_dp_audio_hw_params(struct device *dev,  void *data,
>>               goto out;
>>       }
>>
>> +     memset(buffer, 0, sizeof(buffer));

It is less error prone (and probably makes better code) to just to do
this at init time.  AKA:

u8 buffer[14] = { 0 };

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ