Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1336492pxk; Fri, 18 Sep 2020 09:43:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw81eAkVS4KXKAvHy9PLDdsCRQNASE7YJ/zCBtxOJO0R422KlNbhCijKmPTGBK9YBugRIF X-Received: by 2002:aa7:dc08:: with SMTP id b8mr40766502edu.271.1600447439581; Fri, 18 Sep 2020 09:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600447439; cv=none; d=google.com; s=arc-20160816; b=bp0VQJLsjr5iHgfal5t6BVkPFlh7uRTIuf/QN9BEEt0eOAurYz7VVifDllq7Pw0cEI LTHsqyTo4Z87O4Z3A4IOPX6yPiDP0Ki5/KvX9LnSibQmpmq1A+Da5bBSXQAD7xxyK7iz 5dKiQEc3ZRw/q+bmArOyfQYFe0jEHn+9VDMyHHCICOO0L24Q3kzu8Tih7GUUJ51xPmwL Sj5D7VzbjdCTCTUqKOoa2In2oT2L2DNp+85ngjI1mgrvDtgUuemCSAYSHkypPM6Ipss/ 3c2QPstiN1svbG0K2ndkRIUKBNoRNjhIqOe4W/ShYkSJwORyCtmTKvVpUGJaNNBRjE8f 6zLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=HTVQFxj4AWhEVp8BvBPnQWMoGekr+71vJH4/sBCi+Nc=; b=DsviApJ9xS9BbhtacozHCdnINqI8yC2Nc8CjhZQV9WjP3bmUTXeRtQpHqXkVY9xZzA iwwcgkrf1OG988vXC+u7Ps7omXaaaBvu64gEtB/YYBK84ks7wpLMbgbFA0qKBp2jr1hh PkdQDCZd0yXip/C9LRfrTCsN5/giSW3dsgHfWv9S/oCOw7+AduaH6vI7xXsAa6KuJsUB mpEslHFuFWujVdwdx9BtY7sF16hGwPSv5MEBAtyrbGzaBO5ZRkUkI4EMvOSnwk89SR30 KkGIMnpF+peO9Pis2NtkRzpQ6GLAoVr5CWOEQoHEqqiDl/I1YdSYnxTa3vUVZAWCcaws IpEw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si2547679eda.569.2020.09.18.09.43.36; Fri, 18 Sep 2020 09:43:59 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbgIRQjs (ORCPT + 99 others); Fri, 18 Sep 2020 12:39:48 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44352 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgIRQjs (ORCPT ); Fri, 18 Sep 2020 12:39:48 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212]) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kJJQH-0001Nb-JT; Fri, 18 Sep 2020 16:39:45 +0000 Subject: Re: [PATCH][next] drm/panel: fix null pointer dereference on pointer mode To: =?UTF-8?Q?Guido_G=c3=bcnther?= Cc: Purism Kernel Team , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20200918155136.28958-1-colin.king@canonical.com> <20200918162249.GA292461@bogon.m.sigxcpu.org> From: Colin Ian King Message-ID: <32528660-a9b0-75b2-264d-26d6dc90180c@canonical.com> Date: Fri, 18 Sep 2020 17:39:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.2.1 MIME-Version: 1.0 In-Reply-To: <20200918162249.GA292461@bogon.m.sigxcpu.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/09/2020 17:22, Guido Günther wrote: > Hi, > On Fri, Sep 18, 2020 at 04:51:36PM +0100, Colin King wrote: >> From: Colin Ian King >> >> Currently a null pointer check on pointer mode is passing mode to >> function drm_mode_vrefresh and this causes a null pointer dereference >> on mode. Fix this by not calling drm_mode_vrefresh since the call >> is only required for error reporting. >> >> Addresses-Coverity: ("Dereference after null check") >> Fixes: 72967d5616d3 ("drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel") >> Signed-off-by: Colin Ian King >> --- >> drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c >> index 3482e28e30fc..be4761a643f9 100644 >> --- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c >> +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c >> @@ -202,9 +202,8 @@ static int mantix_get_modes(struct drm_panel *panel, >> >> mode = drm_mode_duplicate(connector->dev, &default_mode); >> if (!mode) { >> - dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", >> - default_mode.hdisplay, default_mode.vdisplay, >> - drm_mode_vrefresh(mode)); >> + dev_err(ctx->dev, "Failed to add mode %ux%u\n", >> + default_mode.hdisplay, default_mode.vdisplay); >> return -ENOMEM; >> } > > drm_mode_vrefresh(&default_mode) gives some more clue what's going on - > I have had a fix queued up in my tree already but if you send a v2 > that's fine. I'll defer to your queued up fix. > > Thanks! > -- Guido > >> >> -- >> 2.27.0 >>