Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5775872rwl; Tue, 11 Apr 2023 09:47:24 -0700 (PDT) X-Google-Smtp-Source: AKy350ajLW8YZBtbVLLPkhjaZtJS7CblvVspvop+67/SwL5UEJ7z4/ndZhh1CseLAuTg7XvrUjV8 X-Received: by 2002:a05:6a20:bb25:b0:cc:63c6:8d3a with SMTP id fc37-20020a056a20bb2500b000cc63c68d3amr2993931pzb.41.1681231644546; Tue, 11 Apr 2023 09:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681231644; cv=none; d=google.com; s=arc-20160816; b=S7qDewCygWRXauxVdB1AIEnQpxdeTcCCorZpBV5A9t2gsUpKpHITojxn7VUjtrWW6Q 4rm/+cqDDgVW8xwbMabqE3fAL30/Izu9hb7mUZfn1VU6EkpdeNIGJIMPFnrLNr2s1TO1 GILZfAIjKyZjDCk7XXAU7w3d3SXwT+8lI4tP6d40u/bTzD0wzazlnGxksgEww0UHgS0P s5IqJUqrAL9WdHopaybzkNwNba2bdAo5i/bHJ7/3f5FbrLKRwnuLchzSPmV7iQMg9nfl JQA68rqWkcXRkP9bwcExFX+plea+onsWO3OcUVV3I+gAu6zWQMm0FugGTng8CJS7UjP2 Ap5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=0CKCWoC0k7KLWRFjtiYq6s4O/Ry3B7Oq7ug3SOT91RI=; b=KH22Z4poBeK0k1XP5gJ+n92tLGJFtHaAK9ynGqW6udS2Z8wXtQS9eGUcLvTtkSasU0 VavU3+UMI+1oX1nM0uwKFhpiOFd2vXk7BPsbLOPZ8/42SU0qjaT8xZrdHfKTy5ZQe4Kl MfdylW6fGok9oQcvpasRbbo1ujPUVguq2QT82n4Kl3Z1TKxuNLsLsZ9pAa589Y0gE7mE KNCl347jdgST95G/vKUJObAjX99ppzG+5KvoP9ABiyTyctDtaMy5E9yutvzjYQKbIZvm 3eK5RPqSvLpi/afMMZA8/gYHmPnK9NSlPvcK7vKyvkZyOSREzl/IkcKgcgTyWQcdWwPv +qPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Hdtc46rj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v16-20020aa799d0000000b00627e1988c78si14044020pfi.143.2023.04.11.09.47.12; Tue, 11 Apr 2023 09:47:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Hdtc46rj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbjDKQqd (ORCPT + 99 others); Tue, 11 Apr 2023 12:46:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbjDKQqY (ORCPT ); Tue, 11 Apr 2023 12:46:24 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAFFA59FA; Tue, 11 Apr 2023 09:46:10 -0700 (PDT) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33BFCKMc021594; Tue, 11 Apr 2023 16:44:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=0CKCWoC0k7KLWRFjtiYq6s4O/Ry3B7Oq7ug3SOT91RI=; b=Hdtc46rjwn9ItMyK3znLdC9hJrUpik9xuAIewQ9vNgz/JORJXEt5KKc1mQvGHbXcyS3u G195KpLwjQIltRsUdMIQiVhZMo/HjLA9agqqSwWnT1FSrLL4/UvVkvsr5J73DTKTLrqN 9K0TjH9KwuiVDyFQKpT8y3GznCU5yLBtw4RP4fIja5vuGwxtAcxVjZJC8oShhSRCO58A l+hFwVk2lBBnFbjGgaAkwguzoS758WgfYizGHa/iT5iuCiP1w7gja8ha0zdX+3F+HD+B MX6ZQ6yHUopF6gRTfSMjSpoxaJEJUuhujwd1u23bvOpkFQgHJPmbqsqnNgTfUI6LI2uG KA== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pw0jpshe4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Apr 2023 16:44:57 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 33BGiu46025508 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Apr 2023 16:44:56 GMT Received: from [10.110.115.18] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Tue, 11 Apr 2023 09:44:55 -0700 Message-ID: Date: Tue, 11 Apr 2023 09:44:54 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH] drm/msm/dpu: Delete a variable initialisation before a null pointer check in two functions Content-Language: en-US To: Markus Elfring , , , , , Archit Taneja , Daniel Vetter , David Airlie , Dmitry Baryshkov , Jeykumar Sankaran , Jordan Crouse , Rob Clark , Sean Paul , Vinod Koul CC: , LKML References: <40c60719-4bfe-b1a4-ead7-724b84637f55@web.de> <1a11455f-ab57-dce0-1677-6beb8492a257@web.de> <13566308-9a80-e4aa-f64e-978c02b1406d@web.de> From: Abhinav Kumar In-Reply-To: <13566308-9a80-e4aa-f64e-978c02b1406d@web.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: X2UpLHKqjQEgmDCCvWadAWe8k_ojcOsu X-Proofpoint-ORIG-GUID: X2UpLHKqjQEgmDCCvWadAWe8k_ojcOsu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-11_11,2023-04-11_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 impostorscore=0 bulkscore=0 phishscore=0 malwarescore=0 suspectscore=0 adultscore=0 spamscore=0 priorityscore=1501 clxscore=1011 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304110152 X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/11/2023 9:38 AM, 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") Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") We usually have 12 chars of the hash. Other than that, Reviewed-by: Abhinav Kumar > 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 >