Re: [v3] thunderbolt: Fix to check the return value of kmemdup
From: Markus Elfring
Date: Fri Oct 11 2019 - 10:13:48 EST
>> This source code analysis approach points out that the implementation
>> of the function âicm_handle_eventâ contains still an unchecked call
>> of the function âkmemdupâ.
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/thunderbolt/icm.c?id=3cdb9446a117d5d63af823bde6fe6babc312e77b#n1627
>> https://elixir.bootlin.com/linux/v5.4-rc2/source/drivers/thunderbolt/icm.c#L1627
>
> Right it misses that.
Thanks for your quick feedback.
> Feel free to send a patch fixing it ;-) Or I can do that myself.
Would you like to reconsider also the addition of the function call
âtb_sw_warn(sw, "cannot allocate memory for switch\n")â?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=9e208aa06c2109b45eec6be049a8e47034748c20#n878
Regards,
Markus