| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Thunderbolt XDomain property support |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2017, Intel Corporation |
|---|
| 5 | 6 | * Authors: Michael Jamet <michael.jamet@intel.com> |
|---|
| 6 | 7 | * 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. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/err.h> |
|---|
| .. | .. |
|---|
| 179 | 176 | } else { |
|---|
| 180 | 177 | dir->uuid = kmemdup(&block[dir_offset], sizeof(*dir->uuid), |
|---|
| 181 | 178 | GFP_KERNEL); |
|---|
| 179 | + if (!dir->uuid) { |
|---|
| 180 | + tb_property_free_dir(dir); |
|---|
| 181 | + return NULL; |
|---|
| 182 | + } |
|---|
| 182 | 183 | content_offset = dir_offset + 4; |
|---|
| 183 | 184 | content_len = dir_len - 4; /* Length includes UUID */ |
|---|
| 184 | 185 | } |
|---|