public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: bin.lan.cn@eng.windriver.com, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 6.6] drm/amd/display: Add NULL pointer check for kzalloc
Date: Fri, 29 Nov 2024 15:03:06 -0500	[thread overview]
Message-ID: <20241129140058-b69db4448612283a@stable.kernel.org> (raw)
In-Reply-To: <20241129053940.3956690-1-bin.lan.cn@eng.windriver.com>

[ Sasha's backport helper bot ]

Hi,

The upstream commit SHA1 provided is correct: 8e65a1b7118acf6af96449e1e66b7adbc9396912

WARNING: Author mismatch between patch and upstream commit:
Backport author: bin.lan.cn@eng.windriver.com
Commit author: Hersen Wu <hersenxs.wu@amd.com>


Status in newer kernel trees:
6.12.y | Present (exact SHA1)
6.11.y | Present (exact SHA1)
6.6.y | Not found

Note: The patch differs from the upstream commit:
---
1:  8e65a1b7118ac ! 1:  a22a302a24281 drm/amd/display: Add NULL pointer check for kzalloc
    @@ Metadata
      ## Commit message ##
         drm/amd/display: Add NULL pointer check for kzalloc
     
    +    [ Upstream commit 8e65a1b7118acf6af96449e1e66b7adbc9396912 ]
    +
         [Why & How]
         Check return pointer of kzalloc before using it.
     
    @@ Commit message
         Acked-by: Wayne Lin <wayne.lin@amd.com>
         Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
         Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    +    [ Resolve minor conflicts ]
    +    Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
     
      ## drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c ##
     @@ drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c: void dcn3_clk_mgr_construct(
    @@ drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c: void dcn32_clk_mgr
      
      void dcn32_clk_mgr_destroy(struct clk_mgr_internal *clk_mgr)
     
    - ## drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c ##
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c: bool dcn30_validate_bandwidth(struct dc *dc,
    + ## drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c ##
    +@@ drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c: bool dcn30_validate_bandwidth(struct dc *dc,
      
      	BW_VAL_TRACE_COUNT();
      
    @@ drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c: bool dcn30_valid
      	out = dcn30_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, true);
      	DC_FP_END();
     
    - ## drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c ##
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c: static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(
    + ## drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c ##
    +@@ drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c: static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(
      
      	/* allocate HPO link encoder */
      	hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL);
    @@ drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c: static struct hp
      
      	hpo_dp_link_encoder31_construct(hpo_dp_enc31, ctx, inst,
      					&hpo_dp_link_enc_regs[inst],
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c: bool dcn31_validate_bandwidth(struct dc *dc,
    +@@ drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c: bool dcn31_validate_bandwidth(struct dc *dc,
      
      	BW_VAL_TRACE_COUNT();
      
    @@ drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c: bool dcn31_valid
      	out = dcn30_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, true);
      	DC_FP_END();
     
    - ## drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c ##
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c: static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(
    + ## drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c ##
    +@@ drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c: static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(
      
      	/* allocate HPO link encoder */
      	hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL);
    @@ drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c: static struct
      
      	hpo_dp_link_encoder31_construct(hpo_dp_enc31, ctx, inst,
      					&hpo_dp_link_enc_regs[inst],
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c: bool dcn314_validate_bandwidth(struct dc *dc,
    +@@ drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c: bool dcn314_validate_bandwidth(struct dc *dc,
      
      	BW_VAL_TRACE_COUNT();
      
    @@ drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c: bool dcn314_va
      		goto validate_fail;
      
     
    - ## drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c ##
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c: static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(
    + ## drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c ##
    +@@ drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c: static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(
      
      	/* allocate HPO link encoder */
      	hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL);
    @@ drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c: static struct
      	hpo_dp_link_encoder31_construct(hpo_dp_enc31, ctx, inst,
      					&hpo_dp_link_enc_regs[inst],
     
    - ## drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c ##
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c: static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(
    + ## drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c ##
    +@@ drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c: static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(
      
      	/* allocate HPO link encoder */
      	hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL);
    @@ drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c: static struct
      	hpo_dp_link_encoder31_construct(hpo_dp_enc31, ctx, inst,
      					&hpo_dp_link_enc_regs[inst],
     
    - ## drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c ##
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c: static struct hpo_dp_link_encoder *dcn32_hpo_dp_link_encoder_create(
    + ## drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c ##
    +@@ drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c: static struct hpo_dp_link_encoder *dcn32_hpo_dp_link_encoder_create(
      
      	/* allocate HPO link encoder */
      	hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL);
    @@ drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c: static struct hp
      
      #undef REG_STRUCT
      #define REG_STRUCT hpo_dp_link_enc_regs
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c: static bool dml1_validate(struct dc *dc, struct dc_state *context, bool fast_val
    +@@ drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c: bool dcn32_validate_bandwidth(struct dc *dc,
      
      	BW_VAL_TRACE_COUNT();
      
    @@ drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c: static bool dml1
      	out = dcn32_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, fast_validate);
      	DC_FP_END();
     
    - ## drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c ##
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn321/dcn321_resource.c: static struct hpo_dp_link_encoder *dcn321_hpo_dp_link_encoder_create(
    - 
    - 	/* allocate HPO link encoder */
    - 	hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL);
    -+	if (!hpo_dp_enc31)
    -+		return NULL; /* out of memory */
    - 
    - #undef REG_STRUCT
    - #define REG_STRUCT hpo_dp_link_enc_regs
    -
    - ## drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c ##
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c: static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(
    - 
    - 	/* allocate HPO link encoder */
    - 	hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL);
    -+	if (!hpo_dp_enc31)
    -+		return NULL; /* out of memory */
    - 
    - #undef REG_STRUCT
    - #define REG_STRUCT hpo_dp_link_enc_regs
    -
    - ## drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c ##
    -@@ drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c: static struct hpo_dp_link_encoder *dcn31_hpo_dp_link_encoder_create(
    + ## drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c ##
    +@@ drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c: static struct hpo_dp_link_encoder *dcn321_hpo_dp_link_encoder_create(
      
      	/* allocate HPO link encoder */
      	hpo_dp_enc31 = kzalloc(sizeof(struct dcn31_hpo_dp_link_encoder), GFP_KERNEL);
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.6.y        |  Success    |  Success   |

      reply	other threads:[~2024-11-29 20:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29  5:39 [PATCH 6.6] drm/amd/display: Add NULL pointer check for kzalloc bin.lan.cn
2024-11-29 20:03 ` Sasha Levin [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=20241129140058-b69db4448612283a@stable.kernel.org \
    --to=sashal@kernel.org \
    --cc=bin.lan.cn@eng.windriver.com \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox