Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1638854pxa; Thu, 20 Aug 2020 17:01:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyz9NnOJAimICKdz7sKKAiS3p43Y0UApCLnsXVQOAPUF0BWs6SqFSVrnWuFLJUYG3kc9NMS X-Received: by 2002:a17:906:d054:: with SMTP id bo20mr379979ejb.9.1597968115170; Thu, 20 Aug 2020 17:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597968115; cv=none; d=google.com; s=arc-20160816; b=j0Eq6c0RpSb/QkvI7gAImcYpR4Q8xL62IC+04j3P1CDzMRQfgMglTg6HaLJs7q/kOS vRdEZvV1QL3tVABn2UqEYsGkEuKVW4bhsn1nKfh3qWOLo05eJtacFZMUwCjFofwwBBWt vahRx//1X4O2e2j6JNck4JsJX7oAdE7JssDnN1shUjC4oflQUO2USrSAVnVLOpz/HP3r 4x8gJwNe9LuFjoMPkEhwpTrFyKWSGVA9pqC4Jvuy8Qx/fr7NrRZ7Hb4AzyzWIae4FkLu QFq6GSb9e84I5nePhM9UDySxsXq1LdD6B0CSwheBm3GD2yW/+87z0e/pUgJp/0hl3QII ZIiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=y4zmQ2bJ9XRhk78qWbsXU4Mo1okBJ5rk8oLN3MDijHg=; b=RKR0kn0FciFPGFaN1V/VFwbJGeZ1cGoKlQiRBrTenTJvAKKJR/FwZBvCvYjlxw0/lN /5j1gRDQvAUuJWPn7JJwKmY8aKx7E+Il2OK6hbfcJNHBmLmfP90h5RAmHe6zeDhCklDJ MLtFHmNu5e/78DQAcnOp2qMJbbE3uW2KPbapaFyurk0H9hb4S9km/mSEe2sts6l35xWA GJS2dCvyGRbGNwGXy1qP+g0pwGyaVLJeYt81prhXap+REa55OvZwyAv8I67BGZ8hlzMF 5ZAWY84QGl5k3aqA60+4p6zDbeML+nzw8WUwWvRnN89jGWUJ9LALtNGfFURLW+KI+fWa yOPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jZnXbZvd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y102si65454ede.258.2020.08.20.17.01.31; Thu, 20 Aug 2020 17:01:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jZnXbZvd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726879AbgHTXx4 (ORCPT + 99 others); Thu, 20 Aug 2020 19:53:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:33174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725885AbgHTXxp (ORCPT ); Thu, 20 Aug 2020 19:53:45 -0400 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00326208E4; Thu, 20 Aug 2020 23:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597967094; bh=OrvMhzElo/BOA9sucY6YNBL0y8bC8eI2i5C7W2muAhY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jZnXbZvd6r/RDmhRl8Pd5bDqWjtnOLOVXZheUhdWXNR8JZL8+j8DXWO/rfJUaVM7s /aoaV762OQv+WFcuD4lrNZquWhQrGZiaGbYEq0edwA/JnZ6oCShF0kGqpoBWarODnk T0eURcudahnEMu2tSEyme9KyN5dYpoIqloRcKgaU= Received: by mail-ej1-f45.google.com with SMTP id jp10so270208ejb.0; Thu, 20 Aug 2020 16:44:53 -0700 (PDT) X-Gm-Message-State: AOAM530u3nGoPADJTPnHkvEnE2WB2jrhLNkpH/EqlIoOE0tMzFxSe0G9 fum59jzwZuTMso6dqZ7etHBv1rTFtJt1nA5wpQ== X-Received: by 2002:a17:906:3a41:: with SMTP id a1mr337598ejf.260.1597967092612; Thu, 20 Aug 2020 16:44:52 -0700 (PDT) MIME-Version: 1.0 References: <1597903458-8055-1-git-send-email-yongqiang.niu@mediatek.com> <1597903458-8055-9-git-send-email-yongqiang.niu@mediatek.com> In-Reply-To: <1597903458-8055-9-git-send-email-yongqiang.niu@mediatek.com> From: Chun-Kuang Hu Date: Fri, 21 Aug 2020 07:44:40 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 08/21] drm/mediatek: check if fb is null To: Yongqiang Niu Cc: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger , Mark Rutland , devicetree@vger.kernel.org, David Airlie , linux-kernel , DRI Development , "moderated list:ARM/Mediatek SoC support" , Daniel Vetter , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yongqiang: Yongqiang Niu =E6=96=BC 2020=E5=B9=B48=E6=9C= =8820=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8B=E5=8D=882:06=E5=AF=AB=E9=81=93= =EF=BC=9A > > It's possible that state->base.fb is null. Add a check before access its > format. Add a Fixes tag. Regards, Chun-Kuang. > > Signed-off-by: Yongqiang Niu > --- > drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/me= diatek/mtk_disp_ovl.c > index 427fe7f..2506803 100644 > --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c > +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c > @@ -269,7 +269,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp = *comp, unsigned int idx, > } > > con =3D ovl_fmt_convert(ovl, fmt); > - if (state->base.fb->format->has_alpha) > + if (state->base.fb && state->base.fb->format->has_alpha) > con |=3D OVL_CON_AEN | OVL_CON_ALPHA; > > if (pending->rotation & DRM_MODE_REFLECT_Y) { > -- > 1.8.1.1.dirty > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek