[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <32c183a5-01bb-f86a-a614-ea46ad405de1@nvidia.com>
Date: Thu, 14 Oct 2021 19:31:22 +0100
From: Jon Hunter <jonathanh@...dia.com>
To: <cgel.zte@...il.com>, <thierry.reding@...il.com>, <arnd@...db.de>
CC: <lv.ruyi@....com.cn>, <linux-tegra@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH V1] firmware: tegra: fix error application of sizeof to
pointer
On 14/10/2021 19:26, Jon Hunter wrote:
> Hi Lv,
>
> On 09/10/2021 09:59, cgel.zte@...il.com wrote:
>> From: Lv Ruyi <lv.ruyi@....com.cn>
>>
>> Application of sizeof to pointer yields the number of bytes of the
>> pointer,
>> but it should use the length of buffer in the code.
>>
>> Reported-by: Zeal Robot <zealci@....com.cn>
>> Signed-off-by: Lv Ruyi <lv.ruyi@....com.cn>
>> ---
>> drivers/firmware/tegra/bpmp-debugfs.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/firmware/tegra/bpmp-debugfs.c
>> b/drivers/firmware/tegra/bpmp-debugfs.c
>> index 6d66fe03fb6a..fd89899aeeed 100644
>> --- a/drivers/firmware/tegra/bpmp-debugfs.c
>> +++ b/drivers/firmware/tegra/bpmp-debugfs.c
>> @@ -77,13 +77,14 @@ static const char *get_filename(struct tegra_bpmp
>> *bpmp,
>> const char *root_path, *filename = NULL;
>> char *root_path_buf;
>> size_t root_len;
>> + size_t root_path_buf_len = 512;
>> - root_path_buf = kzalloc(512, GFP_KERNEL);
>> + root_path_buf = kzalloc(root_path_buf_len, GFP_KERNEL);
>> if (!root_path_buf)
>> goto out;
>> root_path = dentry_path(bpmp->debugfs_mirror, root_path_buf,
>> - sizeof(root_path_buf));
>> + root_path_buf_len);
>> if (IS_ERR(root_path))
>> goto out;
>>
>
> Thanks for fixing this! I just noticed that the debugfs for BPMP is
> broken on -next right now and this fixes it. We should add the fixes tag
> ...
>
> Fixes: 06c2d9a078ab ("firmware: tegra: Reduce stack usage")
>
> Otherwise ...
>
> Reviewed-by: Jon Hunter <jonathanh@...dia.com>
> Tested-by: Jon Hunter <jonathanh@...dia.com>
>
> Arnd, do you want to pick this up?
Nevermind I see that Thierry queued up the offending patch and so I will
ask Thierry to pick this up.
Jon
--
nvpublic
Powered by blists - more mailing lists