From: Markus Elfring <Markus.Elfring@web.de>
To: "Li Huafei" <lihuafei1@huawei.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Christophe Jaillet" <christophe.jaillet@wanadoo.fr>,
"David Airlie" <airlied@gmail.com>,
"Lijo Lazar" <lijo.lazar@amd.com>,
"Simona Vetter" <simona@ffwll.ch>
Cc: LKML <linux-kernel@vger.kernel.org>,
Hawking Zhang <Hawking.Zhang@amd.com>, Le Ma <le.ma@amd.com>,
Likun Gao <Likun.Gao@amd.com>, Ma Jun <Jun.Ma2@amd.com>,
Pratap Nirujogi <Pratap.Nirujogi@amd.com>,
Tim Huang <Tim.Huang@amd.com>,
Victor Lu <victorchengchi.lu@amd.com>,
Xinhui Pan <Xinhui.Pan@amd.com>,
Yifan Zhang <yifan1.zhang@amd.com>
Subject: Re: [PATCH v3] drm/amdgpu: Fix the memory allocation issue in amdgpu_discovery_get_nps_info()
Date: Tue, 29 Oct 2024 20:43:28 +0100 [thread overview]
Message-ID: <58a77f5d-74a1-4ea2-942e-a352f30f66bd@web.de> (raw)
In-Reply-To: <20241029202758.2764535-1-lihuafei1@huawei.com>
…
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -1757,11 +1757,13 @@ int amdgpu_discovery_get_nps_info(struct amdgpu_device *adev,
>
> switch (le16_to_cpu(nps_info->v1.header.version_major)) {
> case 1:
> + mem_ranges = kvcalloc(nps_info->v1.count,
> + sizeof(struct amdgpu_gmc_memrange),
> + GFP_KERNEL);
…
Can the specification “sizeof(*mem_ranges)” be more appropriate here?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.12-rc5#n941
Regards,
Markus
prev parent reply other threads:[~2024-10-30 8:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 20:27 [PATCH v3] drm/amdgpu: Fix the memory allocation issue in amdgpu_discovery_get_nps_info() Li Huafei
2024-10-29 14:02 ` Alex Deucher
2024-10-29 19:43 ` Markus Elfring [this message]
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=58a77f5d-74a1-4ea2-942e-a352f30f66bd@web.de \
--to=markus.elfring@web.de \
--cc=Hawking.Zhang@amd.com \
--cc=Jun.Ma2@amd.com \
--cc=Likun.Gao@amd.com \
--cc=Pratap.Nirujogi@amd.com \
--cc=Tim.Huang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dri-devel@lists.freedesktop.org \
--cc=le.ma@amd.com \
--cc=lihuafei1@huawei.com \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=victorchengchi.lu@amd.com \
--cc=yifan1.zhang@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox