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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E01DDC433EF for ; Fri, 1 Oct 2021 19:04:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AE5AC619F9 for ; Fri, 1 Oct 2021 19:04:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AE5AC619F9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2868A6F37F; Fri, 1 Oct 2021 19:04:16 +0000 (UTC) Received: from so254-9.mailgun.net (so254-9.mailgun.net [198.61.254.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A6F16F37F for ; Fri, 1 Oct 2021 19:04:00 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1633115054; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=ztpbbep24qDfIgL0za8IxIXoVxFrEu0ZThZtqBlDFC4=; b=nG7rY7rn7bHrSD6X5hVA1tf4/Kb+Lf9VWtuk4aeFOTDtQBKxn0H9h13/ZIpE9JWrsjPbz3Pp RxwOQLI7hnYqg34YC+cngSvbGv3hDjhNA0pvsLkVG6LXJW84N2w5f8u7N0N+Tr00E/LpYeIy gJyop1gLIRAEtv9vVsKlHaMmQU0= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyJkOTU5ZSIsICJkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-west-2.postgun.com with SMTP id 61575b89fc6e34f8cdf5199c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 01 Oct 2021 19:03:37 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 4464CC4360C; Fri, 1 Oct 2021 19:03:37 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jesszhan) by smtp.codeaurora.org (Postfix) with ESMTPSA id B62E9C4338F; Fri, 1 Oct 2021 19:03:36 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 01 Oct 2021 12:03:36 -0700 From: jesszhan@codeaurora.org To: Dan Carpenter Cc: jsanka@codeaurora.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [bug report] drm/msm: Add SDM845 DPU support In-Reply-To: <20211001135033.GZ2083@kadam> References: <20211001134912.GA9248@kili> <20211001135033.GZ2083@kadam> Message-ID: X-Sender: jesszhan@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hey Dan, Thanks for the report, will take care of it. On 2021-10-01 06:50, Dan Carpenter wrote: > On Fri, Oct 01, 2021 at 04:49:12PM +0300, Dan Carpenter wrote: >> Hello Jeykumar Sankaran, >> >> This is a semi-automatic email about new static checker warnings. >> >> The patch 25fdd5933e4c: "drm/msm: Add SDM845 DPU support" from Jun >> 27, 2018, leads to the following Smatch complaint: >> >> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c:422 >> _dpu_hw_sspp_setup_scaler3() >> warn: variable dereferenced before check 'ctx->cap->sblk' (see >> line 421) >> >> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c >> 420 (void)pe; >> ^^^^^^^^^ >> You should file a bug report with your compiler devs instead of adding >> these sorts of statements to your code. This function is used as a >> function pointer so unused parameters are normal. >> >> 421 if (_sspp_subblk_offset(ctx, DPU_SSPP_SCALER_QSEED3, &idx) || >> !sspp >> ^^^^^^^^^^^^^^^^^^^^ >> The _sspp_subblk_offset() dereferenced "ctx" before it is checked and >> then it also derefereces "ctx->cap->sblk" without checking. >> >> 422 || !scaler3_cfg || !ctx || !ctx->cap || !ctx->cap->sblk) >> >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> So these will have already crashed before we reach this point. >> > > Same thing later as well. > > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c:591 > dpu_hw_sspp_setup_creq_lut() > warn: variable dereferenced before check 'ctx->cap' (see line 588) > > regards, > dan carpenter Best, Jessica Zhang