[Nouveau] [PATCH 06/10] drm/nouveau/fifo: return ERR_PTR from nvkm_runl_new()
Karol Herbst
kherbst at redhat.com
Tue Jun 13 21:32:32 UTC 2023
On Thu, May 25, 2023 at 2:31 AM Ben Skeggs <skeggsb at gmail.com> wrote:
>
> From: Ben Skeggs <bskeggs at redhat.com>
>
> Callers expect this - not NULL.
>
> Signed-off-by: Ben Skeggs <bskeggs at redhat.com>
> ---
> drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c
> index 93d628d7d508..454a481a0aef 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c
> @@ -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);
> --
> 2.40.1
>
Reviewed-by: Karol Herbst <kherbst at redhat.com>
More information about the Nouveau
mailing list