Skip to contentSkip to conversation

drm/nouveau/fifo: make nvkm_runl_new() return error pointers

PATCH New Dan Carpenter 1 participant 1 message Nov 15, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau/fifo: make nvkm_runl_new() return error pointers

All six callers expect error pointers instead of NULL so make the nvkm_runl_new() return error pointers as expected.

Fixes d94470e9d150 ("drm/nouveau/fifo: add common runlist/engine topology")
---
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c +2 -2
index b5836cbc29aa..adc4a9544ebc 100644
@@ -399,7 +399,7 @@ nvkm_runl_new(struct nvkm_fifo *fifo, int runi, u32 addr, int id_nr)
 	int ret;
 
 	if (!(runl = kzalloc(sizeof(*runl), GFP_KERNEL)))
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	runl->func = fifo->func->runl;
 	runl->fifo = fifo;
@@ -419,7 +419,7 @@ nvkm_runl_new(struct nvkm_fifo *fifo, int runi, u32 addr, int id_nr)
 		    (ret = nvkm_chid_new(&nvkm_chan_event, subdev, id_nr, 0, id_nr, &runl->chid))) {
 			RUNL_ERROR(runl, "cgid/chid: %d", ret);
 			nvkm_runl_del(runl);
-			return NULL;
+			return ERR_PTR(ret);
 		}
 	} else {
 		runl->cgid = nvkm_chid_ref(fifo->cgid);
Signature · 1 line
2.35.1