diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-08-01 13:19:27 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2022-08-01 22:12:33 +0300 |
commit | 88ab1dde792aa6a3902e2a30929e00acc99d351a (patch) | |
tree | 3f7d6df16e2ad66a222cb15da3e89a00dbd8524c /drivers/cxl | |
parent | 452e21cf3438aca19b678d1f182d7d6525648956 (diff) | |
download | linux-88ab1dde792aa6a3902e2a30929e00acc99d351a.tar.xz |
cxl/region: uninitialized variable in alloc_hpa()
This should check "p->res" instead of "res" (which is uninitialized).
Fixes: 23a22cd1c98b ("cxl/region: Allocate HPA capacity to regions")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yueor88I/DkVSOtL@kili
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl')
-rw-r--r-- | drivers/cxl/core/region.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index dc71ec457608..c80932bca667 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -454,7 +454,7 @@ static int alloc_hpa(struct cxl_region *cxlr, resource_size_t size) lockdep_assert_held_write(&cxl_region_rwsem); /* Nothing to do... */ - if (p->res && resource_size(res) == size) + if (p->res && resource_size(p->res) == size) return 0; /* To change size the old size must be freed first */ |