All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] drm/radeon: add a check for allocation failure
@ 2014-08-07 15:27 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2014-08-07 15:27 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Christian König, David Airlie, dri-devel, kernel-janitors

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;
 			tmp->it.start = bo_va->it.start;
 			tmp->it.last = bo_va->it.last;
 			tmp->vm = vm;

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

* [patch] drm/radeon: add a check for allocation failure
@ 2014-08-07 15:27 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2014-08-07 15:27 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Christian König, David Airlie, dri-devel, kernel-janitors

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;
 			tmp->it.start = bo_va->it.start;
 			tmp->it.last = bo_va->it.last;
 			tmp->vm = vm;

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

* Re: [patch] drm/radeon: add a check for allocation failure
  2014-08-07 15:27 ` Dan Carpenter
@ 2014-08-07 15:31   ` Alex Deucher
  -1 siblings, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2014-08-07 15:31 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alex Deucher, kernel-janitors, Christian König,
	Maling list - DRI developers

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

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

* Re: [patch] drm/radeon: add a check for allocation failure
@ 2014-08-07 15:31   ` Alex Deucher
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2014-08-07 15:31 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alex Deucher, kernel-janitors, Christian König,
	Maling list - DRI developers

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

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

* Re: [patch] drm/radeon: add a check for allocation failure
  2014-08-07 15:31   ` Alex Deucher
@ 2014-08-07 15:33     ` Christian König
  -1 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2014-08-07 15:33 UTC (permalink / raw)
  To: Alex Deucher, Dan Carpenter
  Cc: Alex Deucher, kernel-janitors, Maling list - DRI developers

I'm 100% sure that I've fixed that as well with a follow up patch. Looks 
like that one didn't made it into 3.17

Christian.

Am 07.08.2014 um 17:31 schrieb Alex Deucher:
> 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


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

* Re: [patch] drm/radeon: add a check for allocation failure
@ 2014-08-07 15:33     ` Christian König
  0 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2014-08-07 15:33 UTC (permalink / raw)
  To: Alex Deucher, Dan Carpenter
  Cc: Alex Deucher, kernel-janitors, Maling list - DRI developers

I'm 100% sure that I've fixed that as well with a follow up patch. Looks 
like that one didn't made it into 3.17

Christian.

Am 07.08.2014 um 17:31 schrieb Alex Deucher:
> 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

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

* Re: [patch] drm/radeon: add a check for allocation failure
  2014-08-07 15:31   ` Alex Deucher
@ 2014-08-07 15:56     ` Dan Carpenter
  -1 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2014-08-07 15:56 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Alex Deucher, kernel-janitors, Christian König,
	Maling list - DRI developers

On Thu, Aug 07, 2014 at 11:31:15AM -0400, Alex Deucher wrote:
> 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!
> 

Gar.  I'm sorry.  I thought it looked easier than it was.

Also I really should have caught that in my qc.  :/  I'm not sure what
happened.

regards,
dan carpenter


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

* Re: [patch] drm/radeon: add a check for allocation failure
@ 2014-08-07 15:56     ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2014-08-07 15:56 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Alex Deucher, kernel-janitors, Christian König,
	Maling list - DRI developers

On Thu, Aug 07, 2014 at 11:31:15AM -0400, Alex Deucher wrote:
> 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!
> 

Gar.  I'm sorry.  I thought it looked easier than it was.

Also I really should have caught that in my qc.  :/  I'm not sure what
happened.

regards,
dan carpenter

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

end of thread, other threads:[~2014-08-07 15:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.