All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] cxl/region: uninitialized variable in alloc_hpa()
@ 2022-08-01 10:19 Dan Carpenter
  2022-08-01 10:20 ` [PATCH 2/3] cxl/region: prevent underflow in ways_to_cxl() Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Dan Carpenter @ 2022-08-01 10:19 UTC (permalink / raw)
  To: Alison Schofield, Dan Williams
  Cc: Vishal Verma, Ira Weiny, Ben Widawsky, Jonathan Cameron,
	linux-cxl, kernel-janitors

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>
---
 drivers/cxl/core/region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-08-02  6:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-01 10:19 [PATCH 1/3] cxl/region: uninitialized variable in alloc_hpa() Dan Carpenter
2022-08-01 10:20 ` [PATCH 2/3] cxl/region: prevent underflow in ways_to_cxl() Dan Carpenter
2022-08-01 19:09   ` Dan Williams
2022-08-01 10:20 ` [PATCH 3/3] cxl/region: decrement ->nr_targets on error in cxl_region_attach() Dan Carpenter
2022-08-01 10:56   ` Dan Carpenter
2022-08-01 19:49     ` Dan Williams
2022-08-01 19:11   ` Dan Williams
2022-08-01 19:07 ` [PATCH 1/3] cxl/region: uninitialized variable in alloc_hpa() Dan Williams
2022-08-02  6:43   ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.