cxl/region: uninitialized variable in alloc_hpa()
This should check "p->res" instead of "res" (which is uninitialized).
Fixes: 23a22cd1c9
("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>
This commit is contained in:
committed by
Dan Williams
parent
452e21cf34
commit
88ab1dde79
@@ -454,7 +454,7 @@ static int alloc_hpa(struct cxl_region *cxlr, resource_size_t size)
|
|||||||
lockdep_assert_held_write(&cxl_region_rwsem);
|
lockdep_assert_held_write(&cxl_region_rwsem);
|
||||||
|
|
||||||
/* Nothing to do... */
|
/* Nothing to do... */
|
||||||
if (p->res && resource_size(res) == size)
|
if (p->res && resource_size(p->res) == size)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* To change size the old size must be freed first */
|
/* To change size the old size must be freed first */
|
||||||
|
Reference in New Issue
Block a user