Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5038816iog; Wed, 22 Jun 2022 10:39:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tHbJ22tJ2m2eKilawWl+I9QWFEMWQWgpyA+RUwGOhPPxttqWfM11d/SAoOg5ohTY7IJVNT X-Received: by 2002:a17:906:9b86:b0:6fe:d37f:b29d with SMTP id dd6-20020a1709069b8600b006fed37fb29dmr4218800ejc.327.1655919575977; Wed, 22 Jun 2022 10:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655919575; cv=none; d=google.com; s=arc-20160816; b=T7LYqNsVa6LS05eGV5tfzyqGxXfbcfGOCZZZGBOph/FsroeUFIghN9VWTn28ou8U48 5xstWyvFUVJkaidq1BVKReCbLa52tVB9bMO6w/QO3nuodWLSwUaFy+fi+OWNndHAFaxZ dIQrigo3ZL69uznfsrcAj7H1wcgpD+5X19at4kA6THpe8amabhgKohLefimqud+5ZNh1 z47aNavMZEhJ09eI9zuOgGt7tnuQWhiz+Y1IVaP1WWsqiUKxQ+Kp7isWMePE7oBTT93Z 34PDtBWUIxtkyA9FCvylqNnsvWVYWqdO0WRPvSL+dUH/bOYrRvsIHB6ZmPRWOWWrdLUF GDyQ== 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=zqnpY4X29rKyTvgX1mfr7bzlTooayOG6LmPdVgV081s=; b=iSiVKu4x3mswSl9zYYOVsotjZsjsaLCBp8Hlm4a0ebxiDOTgkkWT3/UXSqzHSuv+hW w2uL7cw/MC28ml9iEGusUrivT9X9DI/j/rS8/x6v29bThzm9+cpRKyqIJaj4HyhCuk9V 9/1CQjx+ZWJyNhFO2PcQAVbXSsKT6TTvMQuBm8mo9p6jpY7CJJBKRcGGAKsjnZSskktO ZbCu3U+LY4fJ/gr0sOT29enSRGp6rPlkCOTdyqPQOnmX2/ilBTC1y7ttQnLg373q7kkq 5CEofFdVb3FpqKTuGXcD8nAJTJ3HnewLt6vSCK4vgmlU21Hxa2ad2w6QLIRNIQKmwI7L rEFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=MA4StN2F; 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 hq39-20020a1709073f2700b00711caa783f0si24293002ejc.657.2022.06.22.10.38.46; Wed, 22 Jun 2022 10:39:35 -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=MA4StN2F; 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 S1376752AbiFVR3A (ORCPT + 99 others); Wed, 22 Jun 2022 13:29:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376330AbiFVR27 (ORCPT ); Wed, 22 Jun 2022 13:28:59 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52F216257 for ; Wed, 22 Jun 2022 10:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1655918938; x=1687454938; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=zqnpY4X29rKyTvgX1mfr7bzlTooayOG6LmPdVgV081s=; b=MA4StN2FXn0xL2XjfVOPR8LtLuCAk3OB69FAas94zkv0RMMNew1WosrO gadIB8pZ8c3zOrSg1TMvcF4RYbHv8cG+TZFrt1f2oxxzkooB/iVGLogJw CDdNpIULMzWUpDWMNpvrflxKC0aiNMCfoJmgaQfZlA/Fo6agFjwIS/rEY k=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 22 Jun 2022 10:28:58 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 10:28:57 -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; Wed, 22 Jun 2022 10:28:57 -0700 Received: from [10.111.161.199] (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; Wed, 22 Jun 2022 10:28:55 -0700 Message-ID: <51c48862-967d-fcfa-d744-b234a091a834@quicinc.com> Date: Wed, 22 Jun 2022 10:28:53 -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: Dmitry Baryshkov CC: sunliming , , , , kernel test robot , Dan Carpenter , freedreno References: <20220621110634.368913-1-sunliming@kylinos.cn> <955f881c-7731-a337-3ff9-e58863c41976@quicinc.com> From: Abhinav Kumar In-Reply-To: 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 10:49 AM, Dmitry Baryshkov wrote: > On Tue, 21 Jun 2022 at 20:44, Abhinav Kumar wrote: >> >> Copying freedreno > > The patch needs to be sent to freedreno@. Otherwise it doesn't exist > in patchwork. Ack Hi Sunliming Can you please re-send this and copy freedreno email list along with the Reviewed-by and Reported-by tags which I have given below? Thanks Abhinav > >> >> On 6/21/2022 10:42 AM, Abhinav Kumar wrote: >>> >>> >>> 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); > > >