<p dir="ltr">Dear Mr.Dae,</p>
<p dir="ltr">On Jul 2, 2013 9:42 PM, "Inki Dae" <<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>> wrote:<br>
><br>
> 2013/7/2 YoungJun Cho <<a href="mailto:yj44.cho@samsung.com">yj44.cho@samsung.com</a>>:<br>
> > Dear Ville<br>
> ><br>
> > On Jul 2, 2013 8:42 PM, "Ville Syrjälä" <<a href="mailto:ville.syrjala@linux.intel.com">ville.syrjala@linux.intel.com</a>><br>
> > wrote:<br>
> >><br>
> >> On Tue, Jul 02, 2013 at 07:59:22PM +0900, Seung-Woo Kim wrote:<br>
> >> > From: YoungJun Cho <<a href="mailto:yj44.cho@samsung.com">yj44.cho@samsung.com</a>><br>
> >> ><br>
> >> > When drm iommu is not supported, buf->pages has to be allocated<br>
> >> > and assigned to phys_to_page() result, which type is struct page *.<br>
> >> > So it is sufficient to allocate buf->pages with multiple struct<br>
> >> > page pointer size.<br>
> >> ><br>
> >> > Signed-off-by: YoungJun Cho <<a href="mailto:yj44.cho@samsung.com">yj44.cho@samsung.com</a>><br>
> >> > Signed-off-by: Kyungmin Park <<a href="mailto:kyungmin.park@samsung.com">kyungmin.park@samsung.com</a>><br>
> >> > ---<br>
> >> >  drivers/gpu/drm/exynos/exynos_drm_buf.c |    2 +-<br>
> >> >  1 file changed, 1 insertion(+), 1 deletion(-)<br>
> >> ><br>
> >> > diff --git a/drivers/gpu/drm/exynos/exynos_drm_buf.c<br>
> >> > b/drivers/gpu/drm/exynos/exynos_drm_buf.c<br>
> >> > index 22865ba..3200622 100644<br>
> >> > --- a/drivers/gpu/drm/exynos/exynos_drm_buf.c<br>
> >> > +++ b/drivers/gpu/drm/exynos/exynos_drm_buf.c<br>
> >> > @@ -57,7 +57,7 @@ static int lowlevel_buffer_allocate(struct drm_device<br>
> >> > *dev,<br>
> >> >               dma_addr_t start_addr;<br>
> >> >               unsigned int i = 0;<br>
> >> ><br>
> >> > -             buf->pages = kzalloc(sizeof(struct page) * nr_pages,<br>
> >> > +             buf->pages = kzalloc(sizeof(struct page *) * nr_pages,<br>
> >> >                                       GFP_KERNEL);<br>
> >><br>
> >> Looks like a prime candidate for kcalloc()<br>
> >><br>
> ><br>
> > Thank you for nice comments.<br>
> > I had no idea to consider overflow!<br>
> ><br>
> > I'll update again.<br>
><br>
> Mr. Cho,<br>
><br>
> it seems better to use utility function, drm_calloc_large().<br>
></p>
<p dir="ltr">Your comment is more suitable for this patch. I'll use it.</p>
<p dir="ltr">Thank you!</p>
<p dir="ltr">Best regards YJ</p>
<p dir="ltr">> Thanks,<br>
> Inki Dae<br>
><br>
> ><br>
> > Best regards YJ<br>
> ><br>
> >> >               if (!buf->pages) {<br>
> >> >                       DRM_ERROR("failed to allocate pages.\n");<br>
> >> > --<br>
> >> > 1.7.9.5<br>
> >> ><br>
> >> > _______________________________________________<br>
> >> > dri-devel mailing list<br>
> >> > <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
> >> > <a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
> >><br>
> >> --<br>
> >> Ville Syrjälä<br>
> >> Intel OTC<br>
> >> _______________________________________________<br>
> >> dri-devel mailing list<br>
> >> <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
> >> <a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > dri-devel mailing list<br>
> > <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
> ><br>
> _______________________________________________<br>
> dri-devel mailing list<br>
> <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</p>