Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 2ab7951

Browse files
committed
Merge tag 'cxl-fixes-6.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl
Pull cxl fixes from Dave Jiang: - Compile fix for cxl-test from missing linux/vmalloc.h - Fix for memregion leaks in devm_cxl_add_region() * tag 'cxl-fixes-6.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: cxl/region: Fix memregion leaks in devm_cxl_add_region() cxl/test: Add missing vmalloc.h for tools/testing/cxl/test/mem.c
2 parents f06ce44 + 49ba7b5 commit 2ab7951

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

drivers/cxl/core/region.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,15 +2352,6 @@ static struct cxl_region *devm_cxl_add_region(struct cxl_root_decoder *cxlrd,
23522352
struct device *dev;
23532353
int rc;
23542354

2355-
switch (mode) {
2356-
case CXL_DECODER_RAM:
2357-
case CXL_DECODER_PMEM:
2358-
break;
2359-
default:
2360-
dev_err(&cxlrd->cxlsd.cxld.dev, "unsupported mode %d\n", mode);
2361-
return ERR_PTR(-EINVAL);
2362-
}
2363-
23642355
cxlr = cxl_region_alloc(cxlrd, id);
23652356
if (IS_ERR(cxlr))
23662357
return cxlr;
@@ -2415,6 +2406,15 @@ static struct cxl_region *__create_region(struct cxl_root_decoder *cxlrd,
24152406
{
24162407
int rc;
24172408

2409+
switch (mode) {
2410+
case CXL_DECODER_RAM:
2411+
case CXL_DECODER_PMEM:
2412+
break;
2413+
default:
2414+
dev_err(&cxlrd->cxlsd.cxld.dev, "unsupported mode %d\n", mode);
2415+
return ERR_PTR(-EINVAL);
2416+
}
2417+
24182418
rc = memregion_alloc(GFP_KERNEL);
24192419
if (rc < 0)
24202420
return ERR_PTR(rc);

tools/testing/cxl/test/mem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <linux/platform_device.h>
55
#include <linux/mod_devicetable.h>
6+
#include <linux/vmalloc.h>
67
#include <linux/module.h>
78
#include <linux/delay.h>
89
#include <linux/sizes.h>

0 commit comments

Comments
 (0)