diff mbox

[RESEND] drm: fix drm_local_map allocation size

Message ID 1360657392-27557-1-git-send-email-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula Feb. 12, 2013, 8:23 a.m. UTC
list->map is struct drm_local_map *, not struct drm_map_list *.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

Found this small snippet laying around, I guess it fell between the cracks.
---
 drivers/gpu/drm/drm_gem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jani Nikula April 3, 2013, 9:05 a.m. UTC | #1
ping

On Tue, 12 Feb 2013, Jani Nikula <jani.nikula@intel.com> wrote:
> list->map is struct drm_local_map *, not struct drm_map_list *.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> ---
>
> Found this small snippet laying around, I guess it fell between the cracks.
> ---
>  drivers/gpu/drm/drm_gem.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 24efae4..6337edd 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -343,7 +343,7 @@ drm_gem_create_mmap_offset(struct drm_gem_object *obj)
>  
>  	/* Set the object up for mmap'ing */
>  	list = &obj->map_list;
> -	list->map = kzalloc(sizeof(struct drm_map_list), GFP_KERNEL);
> +	list->map = kzalloc(sizeof(*list->map), GFP_KERNEL);
>  	if (!list->map)
>  		return -ENOMEM;
>  
> -- 
> 1.7.9.5
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 24efae4..6337edd 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -343,7 +343,7 @@  drm_gem_create_mmap_offset(struct drm_gem_object *obj)
 
 	/* Set the object up for mmap'ing */
 	list = &obj->map_list;
-	list->map = kzalloc(sizeof(struct drm_map_list), GFP_KERNEL);
+	list->map = kzalloc(sizeof(*list->map), GFP_KERNEL);
 	if (!list->map)
 		return -ENOMEM;