Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp807855pxf; Thu, 1 Apr 2021 14:14:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1u3kkaRSxTuHjSp9hyoW4Gtzfsx9DqRwvLO81BjEqugEc2dd/r8t30GZzeJxyeP/NGfmS X-Received: by 2002:aa7:d54c:: with SMTP id u12mr12480521edr.234.1617311659753; Thu, 01 Apr 2021 14:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617311659; cv=none; d=google.com; s=arc-20160816; b=M5fdjE+tMhWdEpG+WmmgiCDMIpghBybIxWJKTTnnQRLCXUJO2ueCMzs6cFRQ8rDuIv CxR+oeLs2Bcz52C+TDqYg4NNqPermJyT7Zy8gWD1mkxPvxQGigjoNqbIew60AvzIr9RV EFtRwFL/6pCYLZhbeiXwPx1mr8L/W1ooHQS0wc+sMMq8gz0GPfw6r4ymnZr4WG8Ys38y DNM0YHqTKtZLETvNTGpeoeBPQH3eHk/tORSgVwE7NTXDsvSK6rBG17upD0l/RvDBJXuJ idCOeFMnxysvUPDBAoUiWVK1DVleIIKgk+CwBBX4Jv7awbAjL829Yf8BM/MSKcYjDYud uMMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dn6QNqzedYyCxFSxmCymnqkmYNnWvvinHAK+WCVgT1o=; b=KlkNw5VMmsCKw6155NWSa+QgsXHavd92I/CtJ8thZAsyH9Iytr+YoSCz4zVd9a5EkL 7qGwdieNNrwzo716pK6FHNhVeygHct1N2rniTLCbGHzj45dlRCT01yUir1pTYfg2stVa yJ5WrB2o2eMOPyaj4B7VrElBXq2/1o8Z4gDxskQz7S/W4OXcxb1gh/M+GRc1R3XCwLrA yc3dXkbfeCL1yto8G14vP8xUJkzMCjHxFgzyJTeG7EkXnP9ouQXq7UnM3WMlGe+lG0XB SsHO0l6pVrj0gu6GKMQmQhz8q/xsRBvGb98m91yEEtuDNpKw180MVD8fi5q3BU48+fDz Ei2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="eD3LuB/1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si5020163edy.342.2021.04.01.14.13.56; Thu, 01 Apr 2021 14:14:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="eD3LuB/1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231179AbhDAVKo (ORCPT + 99 others); Thu, 1 Apr 2021 17:10:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233710AbhDAVKo (ORCPT ); Thu, 1 Apr 2021 17:10:44 -0400 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47C3DC0613E6 for ; Thu, 1 Apr 2021 14:10:44 -0700 (PDT) Received: by mail-ot1-x32a.google.com with SMTP id 68-20020a9d0f4a0000b02901b663e6258dso3275912ott.13 for ; Thu, 01 Apr 2021 14:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dn6QNqzedYyCxFSxmCymnqkmYNnWvvinHAK+WCVgT1o=; b=eD3LuB/1TLZ6RQvi2aXVuaq7Mu/BK6RTGFlbZgj9QzZS0B9/VaYkn2iiKXGC/LxVMR 7LBtF9L40qMkvafrx+OTjPicPY0KLHHJQ7kPaD1wYoS38jrWLlXvNRC9ZOpJ/MbzXh5l 7tEyKyJ88E7M3OsTW7tyiybe16wMxuIYQ8Mk5AfOOIx2YFRYYvSs0ti0lh5YXyhagEya 7HZHrzp/7rxyNRkCsJJC1FIKA5wb6AiSACbjkt8ykoA+Qr2nIw/0uM/IMOkdzEZhhOZD k4HA8lB+luvtGDoE0CYZdQjn1mEOCLUnXIUuWhjoSh02BymInuzaMVWzevml3jolBs/q P+nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dn6QNqzedYyCxFSxmCymnqkmYNnWvvinHAK+WCVgT1o=; b=gEjA6lvF+6E8whxvIrucdQyPVMrxDtOjpl+Y6zxwY2pLNlnr7v6CxkmYtBsdYWDbI8 M9RXz1AESNQYIE5vz7Cu9UxeTW1RFR2a0w6P2Rancl1povOWn3pLO2/NY+TXWxVLCKIF lCDcJu7TuQ+wwmdrcWHwFg8YPUkf138Bji+qYfd19HVO0Aexxwvg6HVeQd8K6C2FDICO 2X17UrzJAwL0jFiEHFr47S36kn5sQG2+oH5XsNLMs2N4rSXxeYxtS9U7/4ORFfTAma+9 b8Uf3ok67UFqWMlSK/PbIllo0NngfV0izg2YAI4iwQtZbPygG8IMHBqCFm2JD7efjp2I ALSA== X-Gm-Message-State: AOAM531IsksMHWVVoYpF9VujSR9TjG5sUnQmcyNUpWWE4zjS9MiKwpuM 6L0l+ULQ1w4+QhyWBofzZ75INXdXoy/uON1lXL0= X-Received: by 2002:a9d:7288:: with SMTP id t8mr8955661otj.132.1617311443744; Thu, 01 Apr 2021 14:10:43 -0700 (PDT) MIME-Version: 1.0 References: <20210331131218.60768-1-bernard@vivo.com> In-Reply-To: <20210331131218.60768-1-bernard@vivo.com> From: Alex Deucher Date: Thu, 1 Apr 2021 17:10:32 -0400 Message-ID: Subject: Re: [PATCH] drm/amd: use kmalloc_array over kmalloc with multiply To: Bernard Zhao Cc: Felix Kuehling , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , David Airlie , Daniel Vetter , amd-gfx list , Maling list - DRI developers , LKML , opensource.kernel@vivo.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! On Wed, Mar 31, 2021 at 9:36 AM Bernard Zhao wrote: > > Fix patch check warning: > WARNING: Prefer kmalloc_array over kmalloc with multiply > + buf = kmalloc(MAX_KFIFO_SIZE * sizeof(*buf), GFP_KERNEL); > > Signed-off-by: Bernard Zhao > --- > drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c > index 17d1736367ea..246522423559 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c > @@ -81,7 +81,7 @@ static ssize_t kfd_smi_ev_read(struct file *filep, char __user *user, > struct kfd_smi_client *client = filep->private_data; > unsigned char *buf; > > - buf = kmalloc(MAX_KFIFO_SIZE * sizeof(*buf), GFP_KERNEL); > + buf = kmalloc_array(MAX_KFIFO_SIZE, sizeof(*buf), GFP_KERNEL); > if (!buf) > return -ENOMEM; > > -- > 2.31.0 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx