From: Mika Westerberg Date: Fri, 11 Oct 2019 13:35:57 +0000 Subject: Re: [v3] thunderbolt: Fix to check the return value of kmemdup Message-Id: <20191011133557.GF2819@lahna.fi.intel.com> List-Id: References: <20190325212523.11799-1-pakki001@umn.edu> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Markus Elfring Cc: Aditya Pakki , Andreas Noever , Kangjie Lu , Michael Jamet , Yehezkel Bernat , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org On Fri, Oct 11, 2019 at 03:00:13PM +0200, Markus Elfring wrote: > > uuid in add_switch is allocted via kmemdup which can fail. > > I have tried another script for the semantic patch language out. > 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 https://elixir.bootlin.com/linux/v5.4-rc2/source/drivers/thunderbolt/icm.c#L1627 Right it misses that. > How do you think about to improve it? Feel free to send a patch fixing it ;-) Or I can do that myself.