lkml.org 
[lkml]   [2020]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH V3] clk: vc5: Add memory check to prevent oops
Date
Hi Stephen,

On 21/07/20 11:19, Stephen Boyd wrote:
> Quoting Adam Ford (2020-07-16 05:26:20)
>> When getting the names of the child nodes, kasprintf is used to
>> allocate memory which is used to create the string for the node
>> name. Unfortunately, there is no memory check to determine
>> if this allocation fails, it may cause an error when trying
>> to get child node name.
>>
>> This patch will check if the memory allocation fails, and returns
>> and -ENOMEM error instead of blindly moving on.
>>
>> Fixes: 260249f929e8 ("clk: vc5: Enable addition output configurations of the Versaclock")
>>
>> Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
>> Signed-off-by: Adam Ford <aford173@gmail.com>
>> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
>> ---
>> V3: Fix spelling error, and use the style of checking (!variable) instead of
>> (variable == NULL)
>>
>> V2: Fix an issue where a goto was going to use an unitialized variable.
>
> Is the patch from Colin also needed?
> https://lore.kernel.org/r/20200625132736.88832-1-colin.king@canonical.com

The two patches look completely orthogonal.

--
Luca

\
 
 \ /
  Last update: 2020-07-21 12:10    [W:0.080 / U:1.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site