All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	David Airlie <airlied@linux.ie>,
	Chunming Zhou <david1.zhou@amd.com>
Cc: "Marek Olšák" <marek.olsak@amd.com>,
	kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"monk.liu" <monk.liu@amd.com>
Subject: Re: [patch] drm/amdgpu: cleanup on error in amdgpu_cs_ioctl()
Date: Wed, 04 Nov 2015 14:10:32 +0000	[thread overview]
Message-ID: <563A11D8.20804@vodafone.de> (raw)
In-Reply-To: <20151104132509.GB20966@mwanda>

On 04.11.2015 14:25, Dan Carpenter wrote:
> We recently changed the locking in this function and now there is a
> missing unlock on error.  Also there are some other resources that we
> should probably release as well...
>
> Fixes: f48b2659f521 ('drm/amdgpu: fix the broken vm->mutex V2')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Yeah indeed, thanks for catching this.

Patch is Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
> I'm not terribly familiar with this code.  Please review this one a bit
> carefully.
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 27ef528..dfc4d02 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -876,8 +876,10 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
>   		struct amdgpu_job *job;
>   		struct amdgpu_ring * ring =  parser->ibs->ring;
>   		job = kzalloc(sizeof(struct amdgpu_job), GFP_KERNEL);
> -		if (!job)
> -			return -ENOMEM;
> +		if (!job) {
> +			r = -ENOMEM;
> +			goto out;
> +		}
>   		job->base.sched = &ring->sched;
>   		job->base.s_entity = &parser->ctx->rings[ring->idx].entity;
>   		job->adev = parser->adev;

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <deathsimple@vodafone.de>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	David Airlie <airlied@linux.ie>,
	Chunming Zhou <david1.zhou@amd.com>
Cc: "Marek Olšák" <marek.olsak@amd.com>,
	kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"monk.liu" <monk.liu@amd.com>
Subject: Re: [patch] drm/amdgpu: cleanup on error in amdgpu_cs_ioctl()
Date: Wed, 4 Nov 2015 15:10:32 +0100	[thread overview]
Message-ID: <563A11D8.20804@vodafone.de> (raw)
In-Reply-To: <20151104132509.GB20966@mwanda>

On 04.11.2015 14:25, Dan Carpenter wrote:
> We recently changed the locking in this function and now there is a
> missing unlock on error.  Also there are some other resources that we
> should probably release as well...
>
> Fixes: f48b2659f521 ('drm/amdgpu: fix the broken vm->mutex V2')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Yeah indeed, thanks for catching this.

Patch is Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
> I'm not terribly familiar with this code.  Please review this one a bit
> carefully.
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 27ef528..dfc4d02 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -876,8 +876,10 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
>   		struct amdgpu_job *job;
>   		struct amdgpu_ring * ring =  parser->ibs->ring;
>   		job = kzalloc(sizeof(struct amdgpu_job), GFP_KERNEL);
> -		if (!job)
> -			return -ENOMEM;
> +		if (!job) {
> +			r = -ENOMEM;
> +			goto out;
> +		}
>   		job->base.sched = &ring->sched;
>   		job->base.s_entity = &parser->ctx->rings[ring->idx].entity;
>   		job->adev = parser->adev;

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-11-04 14:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 13:25 [patch] drm/amdgpu: cleanup on error in amdgpu_cs_ioctl() Dan Carpenter
2015-11-04 13:25 ` Dan Carpenter
2015-11-04 14:10 ` Christian König [this message]
2015-11-04 14:10   ` Christian König
2015-11-04 17:15   ` Alex Deucher
2015-11-04 17:15     ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=563A11D8.20804@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=dan.carpenter@oracle.com \
    --cc=david1.zhou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=marek.olsak@amd.com \
    --cc=monk.liu@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.