lkml.org 
[lkml]   [2016]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 1/6] GPU-DRM-GMA500: Use kmalloc_array() in mid_get_vbt_data_r10()
    Date
    On Tue, 20 Sep 2016, SF Markus Elfring <elfring@users.sourceforge.net> wrote:
    > From: Markus Elfring <elfring@users.sourceforge.net>
    > Date: Tue, 20 Sep 2016 08:54:07 +0200
    >
    > A multiplication for the size determination of a memory allocation
    > indicated that an array data structure should be processed.
    > Thus use the corresponding function "kmalloc_array".
    >
    > This issue was detected by using the Coccinelle software.

    Did you test this running on the hardware?

    BR,
    Jani.

    >
    > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    > ---
    > drivers/gpu/drm/gma500/mid_bios.c | 2 +-
    > 1 file changed, 1 insertion(+), 1 deletion(-)
    >
    > diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c
    > index d75ecb3..a833568 100644
    > --- a/drivers/gpu/drm/gma500/mid_bios.c
    > +++ b/drivers/gpu/drm/gma500/mid_bios.c
    > @@ -235,7 +235,7 @@ static int mid_get_vbt_data_r10(struct drm_psb_private *dev_priv, u32 addr)
    > if (read_vbt_r10(addr, &vbt))
    > return -1;
    >
    > - gct = kmalloc(sizeof(*gct) * vbt.panel_count, GFP_KERNEL);
    > + gct = kmalloc_array(vbt.panel_count, sizeof(*gct), GFP_KERNEL);
    > if (!gct)
    > return -1;

    --
    Jani Nikula, Intel Open Source Technology Center

    \
     
     \ /
      Last update: 2016-09-20 12:07    [W:4.149 / U:0.164 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site