All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Ryan Taylor <Ryan.Taylor@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] drm/amdgpu: check for allocation failure in amdgpu_vkms_sw_init()
Date: Fri, 6 Aug 2021 17:09:05 +0200	[thread overview]
Message-ID: <ca0cfa01-e1ef-1ee8-8adc-ebd4fa253e70@amd.com> (raw)
In-Reply-To: <20210806150518.GC15586@kili>

Am 06.08.21 um 17:05 schrieb Dan Carpenter:
> Check whether the kcalloc() fails and return -ENOMEM if it does.
>
> Fixes: eeba0b9046fc ("drm/amdgpu: create amdgpu_vkms (v4)")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
> index 50bdc39733aa..ce982afeff91 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
> @@ -482,6 +482,8 @@ static int amdgpu_vkms_sw_init(void *handle)
>   		return r;
>   
>   	adev->amdgpu_vkms_output = kcalloc(adev->mode_info.num_crtc, sizeof(struct amdgpu_vkms_output), GFP_KERNEL);

Is the line above not a bit long?

> +	if (!adev->amdgpu_vkms_output)
> +		return -ENOMEM;
>   
>   	/* allocate crtcs, encoders, connectors */
>   	for (i = 0; i < adev->mode_info.num_crtc; i++) {


  reply	other threads:[~2021-08-06 15:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 15:05 [PATCH] drm/amdgpu: check for allocation failure in amdgpu_vkms_sw_init() Dan Carpenter
2021-08-06 15:09 ` Christian König [this message]
2021-08-06 19:57   ` Alex Deucher
2021-08-06 19:57     ` Alex Deucher

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=ca0cfa01-e1ef-1ee8-8adc-ebd4fa253e70@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Ryan.Taylor@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.