Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4046813iog; Tue, 21 Jun 2022 10:54:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v7gHZdQsFOAWuQvYeOSR1bXTQTjrHAz3O2wgSiH0QXXJ+d1pyRcOBqti9LbpcwmmFORO4M X-Received: by 2002:a17:90a:6301:b0:1ec:75f5:da3e with SMTP id e1-20020a17090a630100b001ec75f5da3emr26749364pjj.153.1655834089054; Tue, 21 Jun 2022 10:54:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655834089; cv=none; d=google.com; s=arc-20160816; b=QhPZgIs3/Ngzv5C3z2cEKb59GiICVU+Qoc4+dgZUd6CGRXdF8RFxsixYB+lj9a8bs/ 2oD3zmYu+fdZ4WSKjmF8OspFCrFtke4FLqyqglSn6G0vL5ZWPTm4KI+u2FNRlONN665J S8VTSBxSdFi0EXhK7/gz6gHblSYcGVeLeet1VS2Lqt72xbifjveyvDOgvGemuqlWHprt byLUH4Iu1QgPU9At/4+j2DQaZigBZFL2oB9/EHVBOB2R0GCcmgShEzkARXUIBs5/CBfF QPrzF5XR0tg3O7r5Xla/s8ZG/QaLR2ndjmsRLIuqObafajSYwE9pRXuwYUfbnDCNl602 WaFQ== 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=juFpBoX8mv2m0Y+Y+TyQ4uv/9T8Dpez6/NubB+3YFLU=; b=F4EmAwv060/i9HSCYoaVOYMVleI49hII50OCwfreILqjNogK4lvWdl2IJW2jn5V3ZZ xOaRIFknCdUcF4qSCjOjF7qaTTPQKz8/5fYxjwHHB/0iHBIabGQu/QuLe21njhK/snMw Coq2SCYTzEzFFNvofkhHjOAs2Y3FifOQKx4orPXgLAIk5sJ+hj1kHQaBE0+avQ2HVR8w LOfObbAvk30cGOyfisefGi2PPZ3fzJMs7+GUeS4k7qmnZgMKoU4oK3PjkR2FRg/k5KV5 WFwII8hdx5wUSU/+NjkeWMRkMP5vE16Q/Ab/5KuWg3Bm0SJ1CbyI6EkQth9qamupD+5D PEcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=jUZBDZB0; 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 z10-20020a63c04a000000b003fddf71d73bsi875929pgi.742.2022.06.21.10.54.36; Tue, 21 Jun 2022 10:54:49 -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=qcdkim header.b=jUZBDZB0; 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 S237933AbiFURm7 (ORCPT + 99 others); Tue, 21 Jun 2022 13:42:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbiFURm6 (ORCPT ); Tue, 21 Jun 2022 13:42:58 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E25231A81C for ; Tue, 21 Jun 2022 10:42:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1655833371; x=1687369371; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=juFpBoX8mv2m0Y+Y+TyQ4uv/9T8Dpez6/NubB+3YFLU=; b=jUZBDZB0lOjHrVU7I6T61XcI2VghQuAVLBieT4reX8F+GwHtV1hH+QOA ydi1UjmFEqGApKDy59Bffvc8UOejuHDgvipQ1rjQoPjLS29i9fOv3d6TA sLdx57Jo3ahv8zx0Mx30sXGx+xBWTQgvhrmzg3Yfg4toe3VJcAqeEFIQL I=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 21 Jun 2022 10:42:50 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 10:42:50 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 21 Jun 2022 10:42:50 -0700 Received: from [10.38.247.150] (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.22; Tue, 21 Jun 2022 10:42:48 -0700 Message-ID: Date: Tue, 21 Jun 2022 10:42:46 -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: Fix variable dereferenced before check Content-Language: en-US To: sunliming , , CC: , , "kernel test robot" , Dan Carpenter References: <20220621110634.368913-1-sunliming@kylinos.cn> From: Abhinav Kumar In-Reply-To: <20220621110634.368913-1-sunliming@kylinos.cn> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 6/21/2022 4:06 AM, sunliming wrote: > Fixes the following smatch warning: > > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c:261 > dpu_encoder_phys_wb_atomic_check() warn: variable dereferenced before check 'conn_state' > > Reported-by: kernel test robot > Signed-off-by: sunliming Reported-by: Dan Carpenter Reviewed-by: Abhinav Kumar > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c > index 59da348ff339..0ec809ab06e7 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c > @@ -252,11 +252,6 @@ static int dpu_encoder_phys_wb_atomic_check( > DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n", > phys_enc->wb_idx, mode->name, mode->hdisplay, mode->vdisplay); > > - if (!conn_state->writeback_job || !conn_state->writeback_job->fb) > - return 0; > - > - fb = conn_state->writeback_job->fb; > - > if (!conn_state || !conn_state->connector) { > DPU_ERROR("invalid connector state\n"); > return -EINVAL; > @@ -267,6 +262,11 @@ static int dpu_encoder_phys_wb_atomic_check( > return -EINVAL; > } > > + if (!conn_state->writeback_job || !conn_state->writeback_job->fb) > + return 0; > + > + fb = conn_state->writeback_job->fb; > + > DPU_DEBUG("[fb_id:%u][fb:%u,%u]\n", fb->base.id, > fb->width, fb->height); >