thunderbolt: Fix to check for kmemdup failure
authorAditya Pakki <pakki001@umn.edu>
Wed, 20 Mar 2019 15:57:54 +0000 (10:57 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:46:31 +0000 (06:46 -0700)
commit988dab7f5778b70df0428f3a52e459ca9773f25f
tree616ce4b12830f23502531dc883433674b48e49a2
parent877a202f9b27f83f623d08d0d6e20b94722ee16a
thunderbolt: Fix to check for kmemdup failure

[ Upstream commit 2cc12751cf464a722ff57b54d17d30c84553f9c0 ]

Memory allocated via kmemdup might fail and return a NULL pointer.
This patch adds a check on the return value of kmemdup and passes the
error upstream.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thunderbolt/switch.c