Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3466773pxp; Tue, 8 Mar 2022 15:12:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8Y9MLV1mpodmMIsEpYynuEQx9xyMdi8lADaJFFZFYSepGLejC1QVQqBCzl7E50UREws3I X-Received: by 2002:a17:90b:4a4d:b0:1bf:9750:d3d7 with SMTP id lb13-20020a17090b4a4d00b001bf9750d3d7mr4003421pjb.129.1646781168131; Tue, 08 Mar 2022 15:12:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646781168; cv=none; d=google.com; s=arc-20160816; b=Tzv/yG0gfPfROvj7A5Au4bZtsLYJQMYbHBzCY6/Krs2dsfluAo9LnCMOHhVk0vAPuE t+kK5INJCzNA5c0o0orzMsC9BY8b+pi/hDtyYAo4KlyKseDDZoOCNeoX+xPbbuzyScGm IGn8UISkcf/Kr5t1G267CwY2LmOlgLwdF/eLPJssORt2+XY/smBBCxUJSbiILK86NEEU UTcAuipO+w0shYAxn5E3LepRigvXrxsSwq61rgm9NVNg+t4Bi+r/M+bYMwfjkQq3vEE8 RwZ3N8XX4BTJZqP+Byb0dguL/gZQt958UTQ7YU+1yumTXUGxNEP8cVHmdtz+yMmdtLPU ci4Q== 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=X5gEgYlqeY5N1v23I6SIjO/6ZIh9jRkDDdxIcsnIhUs=; b=INFdEWGNTsr6AxB1GS3zW2OfNGIoani9Lr7DsZ2QrhbbC/bbAL+3uQ660xyHN9XQNO 9Aji/j2K8XwnU1AHV9/s5HaCJz5Eiai9NM/c9dmVzM+PW+cN6IUfaIztlpuebL8tyHP0 KfRoSSoXvXymrwgxW5e1WZRXLvu6n5XZt88oOdLOl7/AcRasN34dn4M5MVryAktq6wyB zB2eWF3LOPPPb4uoSbs8NNkTN7M3Q3XI46V6uX5neXUTAN2kC1TNzxoh+aYspVSJLeHU uxEKYzkdblWHUWtIxHXrS/SkFWk2aaL81gZ7HZXKDMJTy0CMr4asiURx9U5spIOGmxKB pH/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ym3sMQo1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bc20-20020a656d94000000b00378a29031dasi199070pgb.228.2022.03.08.15.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 15:12:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ym3sMQo1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CE2196C904; Tue, 8 Mar 2022 15:08:55 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244459AbiCHI3n (ORCPT + 99 others); Tue, 8 Mar 2022 03:29:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233849AbiCHI3l (ORCPT ); Tue, 8 Mar 2022 03:29:41 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ADA23F30A for ; Tue, 8 Mar 2022 00:28:45 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2710BB81686 for ; Tue, 8 Mar 2022 08:28:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF1B3C340EB; Tue, 8 Mar 2022 08:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646728122; bh=LmTt6qQQP0XkYMoZQar+hciBceY5wUpzOfDL2qp0/aM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Ym3sMQo1fM9JBon0wFT7Wa73ahE9ARjcD6RcFSbFx3hvgRMcXBozrZ3thvNugBiW+ 4S959oBIjdUUQL2bTr+1EsVDvnF8BowDy7GX1InlAYCgUn0+MVqgeD5Q8xz2/RHhiF JisOY97woHkFCvsErLBE+NhYY4jlNN2CEJ9CgFtYi6FQADYVogFMezVyD8zrnpNvmo gONNPoQ3Wgii6+RraFfNKaBMKvMqRDktFbKUCcp9ZyVrDO06Sgm/eKEgaZytyyMayN 3TQQAyoyuk25YCgCegLtMsQQ7CYyWTUfGGNQSftpdrpi5uTwRdoG7EEXvrjXRu0FaP m3NFlZclSdopQ== Message-ID: Date: Tue, 8 Mar 2022 10:28:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] drm/omap: fix NULL but dereferenced coccicheck error Content-Language: en-US To: Wan Jiabing , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: kael_w@qq.com References: <20220307095612.409090-1-wanjiabing@vivo.com> From: Tomi Valkeinen In-Reply-To: <20220307095612.409090-1-wanjiabing@vivo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Hi, On 07/03/2022 11:56, Wan Jiabing wrote: > Fix the following coccicheck warning: > ./drivers/gpu/drm/omapdrm/omap_overlay.c:89:22-25: ERROR: r_ovl is NULL > but dereferenced. > > Here should be ovl->idx rather than r_ovl->idx. > > Signed-off-by: Wan Jiabing > --- > drivers/gpu/drm/omapdrm/omap_overlay.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/omapdrm/omap_overlay.c b/drivers/gpu/drm/omapdrm/omap_overlay.c > index 10730c9b2752..b0bc9ad2ef73 100644 > --- a/drivers/gpu/drm/omapdrm/omap_overlay.c > +++ b/drivers/gpu/drm/omapdrm/omap_overlay.c > @@ -86,7 +86,7 @@ int omap_overlay_assign(struct drm_atomic_state *s, struct drm_plane *plane, > r_ovl = omap_plane_find_free_overlay(s->dev, overlay_map, > caps, fourcc); > if (!r_ovl) { > - overlay_map[r_ovl->idx] = NULL; > + overlay_map[ovl->idx] = NULL; > *overlay = NULL; > return -ENOMEM; > } Thanks, I'll pick this up. Tomi