]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
intel_th: msu: Fix missing allocation failure check on a kstrndup
authorColin Ian King <colin.king@canonical.com>
Mon, 28 Oct 2019 07:06:47 +0000 (09:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Nov 2019 14:01:23 +0000 (15:01 +0100)
commit063f097fd65a90fca2cd49411a2d6e35b8ca25db
treef423370f4fad75a99996c1cf433d483abfe1b662
parente5a340f770278f4de42e8bac19f2ebeb77ddfae4
intel_th: msu: Fix missing allocation failure check on a kstrndup

Commit 615c164da0eb ("intel_th: msu: Introduce buffer interface") forgot
to add a NULL pointer check for the value returned from kstrdup(), which
will be troublesome if the allocation fails.

Fix that by adding the check.

Addresses-Coverity: ("Dereference null return")
Fixes: 615c164da0eb ("intel_th: msu: Introduce buffer interface")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
[alexander.shishkin: amended the commit message]
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/lkml/20190726120421.9650-1-colin.king@canonical.com/
Link: https://lore.kernel.org/r/20191028070651.9770-4-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/intel_th/msu.c