All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	kernel-janitors@vger.kernel.org,
	"Christian König" <christian.koenig@amd.com>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>
Subject: Re: [patch] drm/radeon: add a check for allocation failure
Date: Thu, 07 Aug 2014 15:31:15 +0000	[thread overview]
Message-ID: <CADnq5_Mxw=ZY-7cxj440Df6PG4bFDNBvX=v70i4CR5O-277bJw@mail.gmail.com> (raw)
In-Reply-To: <20140807152736.GA10299@mwanda>

On Thu, Aug 7, 2014 at 11:27 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> We can easily return -ENOMEM here if kzalloc() fails.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
> index ccae4d9..d15d987 100644
> --- a/drivers/gpu/drm/radeon/radeon_vm.c
> +++ b/drivers/gpu/drm/radeon/radeon_vm.c
> @@ -483,6 +483,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
>                         /* add a clone of the bo_va to clear the old address */
>                         struct radeon_bo_va *tmp;
>                         tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL);
> +                       if (!tmp)
> +                               return -ENOMEM;

We need to drop the lock here too.  I'll apply and fix it up.  Thanks!

Alex

>                         tmp->it.start = bo_va->it.start;
>                         tmp->it.last = bo_va->it.last;
>                         tmp->vm = vm;
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
	kernel-janitors@vger.kernel.org,
	"Christian König" <christian.koenig@amd.com>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>
Subject: Re: [patch] drm/radeon: add a check for allocation failure
Date: Thu, 7 Aug 2014 11:31:15 -0400	[thread overview]
Message-ID: <CADnq5_Mxw=ZY-7cxj440Df6PG4bFDNBvX=v70i4CR5O-277bJw@mail.gmail.com> (raw)
In-Reply-To: <20140807152736.GA10299@mwanda>

On Thu, Aug 7, 2014 at 11:27 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> We can easily return -ENOMEM here if kzalloc() fails.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
> index ccae4d9..d15d987 100644
> --- a/drivers/gpu/drm/radeon/radeon_vm.c
> +++ b/drivers/gpu/drm/radeon/radeon_vm.c
> @@ -483,6 +483,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
>                         /* add a clone of the bo_va to clear the old address */
>                         struct radeon_bo_va *tmp;
>                         tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL);
> +                       if (!tmp)
> +                               return -ENOMEM;

We need to drop the lock here too.  I'll apply and fix it up.  Thanks!

Alex

>                         tmp->it.start = bo_va->it.start;
>                         tmp->it.last = bo_va->it.last;
>                         tmp->vm = vm;
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2014-08-07 15:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07 15:27 [patch] drm/radeon: add a check for allocation failure Dan Carpenter
2014-08-07 15:27 ` Dan Carpenter
2014-08-07 15:31 ` Alex Deucher [this message]
2014-08-07 15:31   ` Alex Deucher
2014-08-07 15:33   ` Christian König
2014-08-07 15:33     ` Christian König
2014-08-07 15:56   ` Dan Carpenter
2014-08-07 15:56     ` Dan Carpenter

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='CADnq5_Mxw=ZY-7cxj440Df6PG4bFDNBvX=v70i4CR5O-277bJw@mail.gmail.com' \
    --to=alexdeucher@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    /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.