From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0565C77B75 for ; Tue, 11 Apr 2023 16:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229654AbjDKQnL (ORCPT ); Tue, 11 Apr 2023 12:43:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjDKQnK (ORCPT ); Tue, 11 Apr 2023 12:43:10 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32EE6172C for ; Tue, 11 Apr 2023 09:43:09 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id e9so38418032ljq.4 for ; Tue, 11 Apr 2023 09:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681231387; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=f+Yn3w4i6ERhJRbEalDkX81nXU5W6d0rrV0jXP7xE40=; b=QFgUdLSiBrEwNbHQ04X1boTAoorIGTiF6sCjmJuNEhDh5YRYplW2HFsR/8qPj/zRH6 bFS+gA3Kcbkf5sO/PY5yrQ2o2ENpG6g4z5qxUGFRBvtZSFGdmi6K/UO+W6AEXlEjWD31 Pr50qHaLDkwLcPVUVVGO/FK9xlZ+qAwk6dBMFFp5pmfikoC8gr1g29K6Didkx5KkdYsJ OEgBDmqZ1qAXNZ9EcusjJDJ1R9zA76y0Nngb0ZJtx7apwCfRD8zhizpFLAj5q31eZXl2 qWAXXNYtMDXsNjdtbojR9WBVyRNxyw2y2pbxV3Sb2WrvPyD17LGjevDRBLeTLq0tDcp9 c1Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681231387; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=f+Yn3w4i6ERhJRbEalDkX81nXU5W6d0rrV0jXP7xE40=; b=Mo7Y8dVI/cY4HbKDHclOgGh17lKmHtoTwRkyOz6uv6quwTYvCdkv1ykkTBkhqB6aUr Q/MaL6yjZjD9IfWG+xtar9zL8/7rZAvrxODshvFd/WJCGkuSe9SrYPpypqEn+u59W55c bEmfjNfraotRDIhAfSvo32SNLTB2sCSz6NeIKqB5W3KLoMdBI8zx2XVQjillIFTtlqa5 nEyyIVXera8XCH7etifoBW/7p9iTsI5uGZSYEgjRWxcPCYFxT2O8dy9xWdA2ktnYUIG4 gr8bnXTW4CABCWvKUc73M3+mtXZAxvp2VEMFXNDlPH4aF5L9SEWjhJNRbXOHtQSlHDou cR7Q== X-Gm-Message-State: AAQBX9dVevoMl/Oopv5aUUCkJbrPqlCPPzp8Z4fP4iiKL7uY6gGfTH76 uY+r3iITVAaMDtVaw2OOcbMWhw== X-Google-Smtp-Source: AKy350bMk4SkskVqv2ia31J+GxA0ArmyEzCNBnop1DJ9H7MWNk8XMD336eB/RYppFHgASDqtT8IemQ== X-Received: by 2002:a2e:82ce:0:b0:2a2:ca91:a99e with SMTP id n14-20020a2e82ce000000b002a2ca91a99emr4943313ljh.39.1681231387322; Tue, 11 Apr 2023 09:43:07 -0700 (PDT) Received: from ?IPV6:2001:14ba:a085:4d00::8a5? (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id x28-20020ac25ddc000000b004e8017a2510sm2606561lfq.183.2023.04.11.09.43.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Apr 2023 09:43:06 -0700 (PDT) Message-ID: <90f32378-fa1c-a23e-2db2-2e83a42fd45e@linaro.org> Date: Tue, 11 Apr 2023 19:43:06 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] drm/msm/dpu: Delete a variable initialisation before a null pointer check in two functions Content-Language: en-GB To: Markus Elfring , kernel-janitors@vger.kernel.org, freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Abhinav Kumar , Archit Taneja , Daniel Vetter , David Airlie , Jeykumar Sankaran , Jordan Crouse , Rob Clark , Sean Paul , Vinod Koul Cc: cocci@inria.fr, LKML References: <40c60719-4bfe-b1a4-ead7-724b84637f55@web.de> <1a11455f-ab57-dce0-1677-6beb8492a257@web.de> <13566308-9a80-e4aa-f64e-978c02b1406d@web.de> From: Dmitry Baryshkov In-Reply-To: <13566308-9a80-e4aa-f64e-978c02b1406d@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E283C77B70 for ; Tue, 11 Apr 2023 16:43:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EE8A10E105; Tue, 11 Apr 2023 16:43:11 +0000 (UTC) Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC57810E5A8 for ; Tue, 11 Apr 2023 16:43:09 +0000 (UTC) Received: by mail-lj1-x22d.google.com with SMTP id bx15so7212233ljb.7 for ; Tue, 11 Apr 2023 09:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681231387; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=f+Yn3w4i6ERhJRbEalDkX81nXU5W6d0rrV0jXP7xE40=; b=QFgUdLSiBrEwNbHQ04X1boTAoorIGTiF6sCjmJuNEhDh5YRYplW2HFsR/8qPj/zRH6 bFS+gA3Kcbkf5sO/PY5yrQ2o2ENpG6g4z5qxUGFRBvtZSFGdmi6K/UO+W6AEXlEjWD31 Pr50qHaLDkwLcPVUVVGO/FK9xlZ+qAwk6dBMFFp5pmfikoC8gr1g29K6Didkx5KkdYsJ OEgBDmqZ1qAXNZ9EcusjJDJ1R9zA76y0Nngb0ZJtx7apwCfRD8zhizpFLAj5q31eZXl2 qWAXXNYtMDXsNjdtbojR9WBVyRNxyw2y2pbxV3Sb2WrvPyD17LGjevDRBLeTLq0tDcp9 c1Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681231387; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=f+Yn3w4i6ERhJRbEalDkX81nXU5W6d0rrV0jXP7xE40=; b=V0g0qWGM764N9zsqP6pcfT167glpFQcuGi0Bvkn0oPBcnN55JKSRVzPxF+OCwrmUiA MWYjhwe5Gn5FzKLsCzX/wkWKTLKQK6rzLrjpEHWPMGAP4yvYBJ3Q7Qp0933SF6BBbXzK aT3P5xEAUuAkYUL5yfu7nVkRZYHModmwzuPDo8n1tOEjtY2/6hHOhibaG5AIcnAtv0Cy 0dzUB/0AtqbXPidqOMk4I/AvxA44M4DXT7yiRgRjTmHk0Tc/z79BlX2K1UIyqXZMUR4r nOynkSLGeEA+P/iM68GsvMOkQHbmG2jA9sSZFwcsNezffGsHxTMlr2AvxRLnu2SajLOR IjRA== X-Gm-Message-State: AAQBX9ftHucZ8zmoHvfDmGvOMz7AtY7oU0P4C10nEUWi8vxjTmAUGZsJ PdD5EEP/izeE9ExtU5bMu3lBZw== X-Google-Smtp-Source: AKy350bMk4SkskVqv2ia31J+GxA0ArmyEzCNBnop1DJ9H7MWNk8XMD336eB/RYppFHgASDqtT8IemQ== X-Received: by 2002:a2e:82ce:0:b0:2a2:ca91:a99e with SMTP id n14-20020a2e82ce000000b002a2ca91a99emr4943313ljh.39.1681231387322; Tue, 11 Apr 2023 09:43:07 -0700 (PDT) Received: from ?IPV6:2001:14ba:a085:4d00::8a5? (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id x28-20020ac25ddc000000b004e8017a2510sm2606561lfq.183.2023.04.11.09.43.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Apr 2023 09:43:06 -0700 (PDT) Message-ID: <90f32378-fa1c-a23e-2db2-2e83a42fd45e@linaro.org> Date: Tue, 11 Apr 2023 19:43:06 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] drm/msm/dpu: Delete a variable initialisation before a null pointer check in two functions Content-Language: en-GB To: Markus Elfring , kernel-janitors@vger.kernel.org, freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Abhinav Kumar , Archit Taneja , Daniel Vetter , David Airlie , Jeykumar Sankaran , Jordan Crouse , Rob Clark , Sean Paul , Vinod Koul References: <40c60719-4bfe-b1a4-ead7-724b84637f55@web.de> <1a11455f-ab57-dce0-1677-6beb8492a257@web.de> <13566308-9a80-e4aa-f64e-978c02b1406d@web.de> From: Dmitry Baryshkov In-Reply-To: <13566308-9a80-e4aa-f64e-978c02b1406d@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: LKML , cocci@inria.fr Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 > --- > 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