All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] amdkfd: actually allocate longs for the pasid bitmask
@ 2014-12-28 16:44 Sasha Levin
  2014-12-29  8:51   ` Oded Gabbay
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2014-12-28 16:44 UTC (permalink / raw)
  To: oded.gabbay
  Cc: airlied, alexander.deucher, j.glisse, linux-kernel, dri-devel,
	John.Bridgman, Andrew.Lewycky, joro, Sasha Levin

Commit "amdkfd: use sizeof(long) granularity for the pasid bitmask" calculated
the number of longs it will need, but ended up allocating that number of
bytes rather than longs.

Fix that silly error and allocate the amount of data really required.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_pasid.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c b/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
index 71699ad..4c25ef5 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
@@ -32,7 +32,7 @@ int kfd_pasid_init(void)
 {
 	pasid_limit = max_num_of_processes;
 
-	pasid_bitmap = kzalloc(BITS_TO_LONGS(pasid_limit), GFP_KERNEL);
+	pasid_bitmap = kcalloc(BITS_TO_LONGS(pasid_limit), sizeof(long), GFP_KERNEL);
 	if (!pasid_bitmap)
 		return -ENOMEM;
 
-- 
1.7.10.4

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

* Re: [PATCH] amdkfd: actually allocate longs for the pasid bitmask
  2014-12-28 16:44 [PATCH] amdkfd: actually allocate longs for the pasid bitmask Sasha Levin
@ 2014-12-29  8:51   ` Oded Gabbay
  0 siblings, 0 replies; 3+ messages in thread
From: Oded Gabbay @ 2014-12-29  8:51 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Andrew.Lewycky, linux-kernel, dri-devel, alexander.deucher



On 12/28/2014 06:44 PM, Sasha Levin wrote:
> Commit "amdkfd: use sizeof(long) granularity for the pasid bitmask" calculated
> the number of longs it will need, but ended up allocating that number of
> bytes rather than longs.
>
> Fix that silly error and allocate the amount of data really required.
>
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_pasid.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c b/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
> index 71699ad..4c25ef5 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
> @@ -32,7 +32,7 @@ int kfd_pasid_init(void)
>   {
>   	pasid_limit = max_num_of_processes;
>
> -	pasid_bitmap = kzalloc(BITS_TO_LONGS(pasid_limit), GFP_KERNEL);
> +	pasid_bitmap = kcalloc(BITS_TO_LONGS(pasid_limit), sizeof(long), GFP_KERNEL);
>   	if (!pasid_bitmap)
>   		return -ENOMEM;
>
>
Thanks!
Applied to my amdkfd-fixes tree.

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

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

* Re: [PATCH] amdkfd: actually allocate longs for the pasid bitmask
@ 2014-12-29  8:51   ` Oded Gabbay
  0 siblings, 0 replies; 3+ messages in thread
From: Oded Gabbay @ 2014-12-29  8:51 UTC (permalink / raw)
  To: Sasha Levin
  Cc: airlied, alexander.deucher, j.glisse, linux-kernel, dri-devel,
	John.Bridgman, Andrew.Lewycky, joro



On 12/28/2014 06:44 PM, Sasha Levin wrote:
> Commit "amdkfd: use sizeof(long) granularity for the pasid bitmask" calculated
> the number of longs it will need, but ended up allocating that number of
> bytes rather than longs.
>
> Fix that silly error and allocate the amount of data really required.
>
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_pasid.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c b/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
> index 71699ad..4c25ef5 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
> @@ -32,7 +32,7 @@ int kfd_pasid_init(void)
>   {
>   	pasid_limit = max_num_of_processes;
>
> -	pasid_bitmap = kzalloc(BITS_TO_LONGS(pasid_limit), GFP_KERNEL);
> +	pasid_bitmap = kcalloc(BITS_TO_LONGS(pasid_limit), sizeof(long), GFP_KERNEL);
>   	if (!pasid_bitmap)
>   		return -ENOMEM;
>
>
Thanks!
Applied to my amdkfd-fixes tree.

	Oded

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

end of thread, other threads:[~2014-12-29  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-28 16:44 [PATCH] amdkfd: actually allocate longs for the pasid bitmask Sasha Levin
2014-12-29  8:51 ` Oded Gabbay
2014-12-29  8:51   ` Oded Gabbay

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.