diff options
| -rw-r--r-- | drivers/nvdimm/namespace_devs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c index 7849bf1812c4..f293556cbbf6 100644 --- a/drivers/nvdimm/namespace_devs.c +++ b/drivers/nvdimm/namespace_devs.c | |||
| @@ -2249,9 +2249,12 @@ static struct device *create_namespace_blk(struct nd_region *nd_region, | |||
| 2249 | if (!nsblk->uuid) | 2249 | if (!nsblk->uuid) |
| 2250 | goto blk_err; | 2250 | goto blk_err; |
| 2251 | memcpy(name, nd_label->name, NSLABEL_NAME_LEN); | 2251 | memcpy(name, nd_label->name, NSLABEL_NAME_LEN); |
| 2252 | if (name[0]) | 2252 | if (name[0]) { |
| 2253 | nsblk->alt_name = kmemdup(name, NSLABEL_NAME_LEN, | 2253 | nsblk->alt_name = kmemdup(name, NSLABEL_NAME_LEN, |
| 2254 | GFP_KERNEL); | 2254 | GFP_KERNEL); |
| 2255 | if (!nsblk->alt_name) | ||
| 2256 | goto blk_err; | ||
| 2257 | } | ||
| 2255 | res = nsblk_add_resource(nd_region, ndd, nsblk, | 2258 | res = nsblk_add_resource(nd_region, ndd, nsblk, |
| 2256 | __le64_to_cpu(nd_label->dpa)); | 2259 | __le64_to_cpu(nd_label->dpa)); |
| 2257 | if (!res) | 2260 | if (!res) |
