hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/thunderbolt/property.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Thunderbolt XDomain property support
34 *
45 * Copyright (C) 2017, Intel Corporation
56 * Authors: Michael Jamet <michael.jamet@intel.com>
67 * Mika Westerberg <mika.westerberg@linux.intel.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/err.h>
....@@ -179,6 +176,10 @@
179176 } else {
180177 dir->uuid = kmemdup(&block[dir_offset], sizeof(*dir->uuid),
181178 GFP_KERNEL);
179
+ if (!dir->uuid) {
180
+ tb_property_free_dir(dir);
181
+ return NULL;
182
+ }
182183 content_offset = dir_offset + 4;
183184 content_len = dir_len - 4; /* Length includes UUID */
184185 }