From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH] drm/exynos: fix pages allocation in lowlevel_buffer_allocate Date: Tue, 2 Jul 2013 14:36:50 +0300 Message-ID: <20130702113650.GO5004@intel.com> References: <1372762762-15480-1-git-send-email-sw0312.kim@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id B2EE0E619B for ; Tue, 2 Jul 2013 04:41:54 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1372762762-15480-1-git-send-email-sw0312.kim@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Seung-Woo Kim Cc: kyungmin.park@samsung.com, yj44.cho@samsung.com, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, Jul 02, 2013 at 07:59:22PM +0900, Seung-Woo Kim wrote: > From: YoungJun Cho > = > 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 > Signed-off-by: Kyungmin Park > --- > 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/ex= ynos/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 =3D 0; > = > - buf->pages =3D kzalloc(sizeof(struct page) * nr_pages, > + buf->pages =3D 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=E4l=E4 Intel OTC