From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Markus Elfring <Markus.Elfring@web.de>,
kernel-janitors@vger.kernel.org, freedreno@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Archit Taneja <architt@codeaurora.org>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>,
Jeykumar Sankaran <jsanka@codeaurora.org>,
Jordan Crouse <jordan@cosmicpenguin.net>,
Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
Vinod Koul <vkoul@kernel.org>
Cc: cocci@inria.fr, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/msm/dpu: Delete a variable initialisation before a null pointer check in two functions
Date: Tue, 11 Apr 2023 19:43:06 +0300 [thread overview]
Message-ID: <90f32378-fa1c-a23e-2db2-2e83a42fd45e@linaro.org> (raw)
In-Reply-To: <13566308-9a80-e4aa-f64e-978c02b1406d@web.de>
On 11/04/2023 19:38, Markus Elfring wrote:
> Date: Tue, 11 Apr 2023 18:24:24 +0200
>
> The address of a data structure member was determined before
> a corresponding null pointer check in the implementation of
> the functions “dpu_hw_pp_enable_te” and “dpu_hw_pp_get_vsync_info”.
>
> Thus avoid the risk for undefined behaviour by removing extra
> initialisations for the variable “c” (also because it was already
> reassigned with the same value behind this pointer check).
>
> This issue was detected by using the Coccinelle software.
>
> Fixes: 25fdd5933e4c0f5fe2ea5cd59994f8ac5fbe90ef ("drm/msm: Add SDM845 DPU support")
Plese follow the format for the Fixes tags and limit the hash to 12
chars. Proper tag:
Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
Other than that LGTM.
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c
> index 0fcad9760b6f..870ab3ebbc94 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c
> @@ -176,7 +176,7 @@ static int dpu_hw_pp_enable_te(struct dpu_hw_pingpong *pp, bool enable)
> static int dpu_hw_pp_connect_external_te(struct dpu_hw_pingpong *pp,
> bool enable_external_te)
> {
> - struct dpu_hw_blk_reg_map *c = &pp->hw;
> + struct dpu_hw_blk_reg_map *c;
> u32 cfg;
> int orig;
>
> @@ -221,7 +221,7 @@ static int dpu_hw_pp_get_vsync_info(struct dpu_hw_pingpong *pp,
>
> static u32 dpu_hw_pp_get_line_count(struct dpu_hw_pingpong *pp)
> {
> - struct dpu_hw_blk_reg_map *c = &pp->hw;
> + struct dpu_hw_blk_reg_map *c;
> u32 height, init;
> u32 line = 0xFFFF;
>
> --
> 2.40.0
>
--
With best wishes
Dmitry
next parent reply other threads:[~2023-04-11 16:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <40c60719-4bfe-b1a4-ead7-724b84637f55@web.de>
[not found] ` <1a11455f-ab57-dce0-1677-6beb8492a257@web.de>
[not found] ` <13566308-9a80-e4aa-f64e-978c02b1406d@web.de>
2023-04-11 16:43 ` Dmitry Baryshkov [this message]
2023-04-11 16:44 ` [PATCH] drm/msm/dpu: Delete a variable initialisation before a null pointer check in two functions Abhinav Kumar
2025-03-02 20:56 ` [PATCH RESEND] " Markus Elfring
2025-03-02 23:01 ` Dmitry Baryshkov
2025-03-03 7:14 ` Dan Carpenter
2025-03-03 8:15 ` [RESEND] " Markus Elfring
2025-03-03 8:24 ` Dan Carpenter
2025-03-05 8:40 ` [RFC] Clarification for “undefined behaviour”? Markus Elfring
2025-03-05 8:51 ` Dan Carpenter
2025-03-05 9:20 ` Markus Elfring
2025-03-05 14:17 ` David Laight
2025-03-05 14:30 ` Dan Carpenter
2025-03-05 21:35 ` David Laight
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=90f32378-fa1c-a23e-2db2-2e83a42fd45e@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=Markus.Elfring@web.de \
--cc=airlied@gmail.com \
--cc=architt@codeaurora.org \
--cc=cocci@inria.fr \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jordan@cosmicpenguin.net \
--cc=jsanka@codeaurora.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=vkoul@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