All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: kyungmin.park@samsung.com, yj44.cho@samsung.com,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/exynos: fix pages allocation in lowlevel_buffer_allocate
Date: Tue, 2 Jul 2013 14:36:50 +0300	[thread overview]
Message-ID: <20130702113650.GO5004@intel.com> (raw)
In-Reply-To: <1372762762-15480-1-git-send-email-sw0312.kim@samsung.com>

On Tue, Jul 02, 2013 at 07:59:22PM +0900, Seung-Woo Kim wrote:
> From: YoungJun Cho <yj44.cho@samsung.com>
> 
> When drm iommu is not supported, buf->pages has to be allocated
> and assigned to phys_to_page() result, which type is struct page *.
> So it is sufficient to allocate buf->pages with multiple struct
> page pointer size.
> 
> Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_buf.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_buf.c b/drivers/gpu/drm/exynos/exynos_drm_buf.c
> index 22865ba..3200622 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_buf.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_buf.c
> @@ -57,7 +57,7 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
>  		dma_addr_t start_addr;
>  		unsigned int i = 0;
>  
> -		buf->pages = kzalloc(sizeof(struct page) * nr_pages,
> +		buf->pages = kzalloc(sizeof(struct page *) * nr_pages,
>  					GFP_KERNEL);

Looks like a prime candidate for kcalloc()

>  		if (!buf->pages) {
>  			DRM_ERROR("failed to allocate pages.\n");
> -- 
> 1.7.9.5
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2013-07-02 11:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 10:59 [PATCH] drm/exynos: fix pages allocation in lowlevel_buffer_allocate Seung-Woo Kim
2013-07-02 11:36 ` Ville Syrjälä [this message]
2013-07-02 12:23   ` YoungJun Cho
2013-07-02 12:41     ` Inki Dae
2013-07-03  0:07       ` YoungJun Cho
2013-07-03  8:09       ` [PATCH 1/3] drm/exynos: use drm_calloc_large when allocates pointer array Seung-Woo Kim
2013-07-03  8:09         ` [PATCH v2 2/3] drm/exynos: fix pages allocation size in lowlevel_buffer_allocate Seung-Woo Kim
2013-07-03  8:09         ` [PATCH 3/3] drm/exynos: remove duplicated error routine and unnecessary assign Seung-Woo Kim

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=20130702113650.GO5004@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kyungmin.park@samsung.com \
    --cc=sw0312.kim@samsung.com \
    --cc=yj44.cho@samsung.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.