Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1327629pxk; Fri, 18 Sep 2020 09:30:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw86d/4PRSvZaO5yp7qxsRKrS1NTxIteJZxl37wY1XnmJZgwON/LMYYCvLBLPivVv3VEnBU X-Received: by 2002:a17:906:f90c:: with SMTP id lc12mr36284703ejb.104.1600446630660; Fri, 18 Sep 2020 09:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600446630; cv=none; d=google.com; s=arc-20160816; b=VTYZ72IK1zuL/6KVaVe/JIiolrkAKfYPwVZbumwFWd1TEOvNKwgYYC6VHpGYyx4Q4L XpxcLPVB0Y8+Za6u7CiMcIuL/y3J4u6mrzG32xpeSBPIT5Ny7fKhI+gDGnS/oIGY0Yup 8jdgHp8nDpm4fH+bRO6JR7PSbu4UWztxPpToRCB/cW8Dv7+UTsDIN8sCnPspEZp/TTKe QIdGW/Y+/x519oxjrzYSgyUK7sEf8Pwm84g0kSjQfGRuNGXihYvC8PwsQULi4vGPFhrU bqz/C2VrlTMh9AjMJkjJ3T3YEpTg2SiWEoG9csaaOVLeuv0NDmI3bzzkI20oqIHaD3Z4 /z7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=mPJ6VziWnQKIHhNGy3FDTMgdvFpCdSL1QfCmWI/Y0NE=; b=nyoBpVhWvbcem2D9xkfduOQXbYx9nz/Vj/1BJvqqtbaIWET4oA0DyxKGw86YX3q0DF 3PyOTFwZO+akBScnbyIngW1hcoiLRSW5Z0MwfLlgDN3cyNKF4yMdJZd788wmF68ALG0l 5PzMNHw07vq3lLY6Iso+QDsyH4pZC0xqR2jDTTP9suOkIIVY7CqAf463XrRyfoW8A4lN Lippwdsi1oRi9a3fPmdpxIWxLF+cTpYULnAZ/o+61Vl+Hw22kKQJp+AGNM0jgBOVE6H1 i7ZddorEuTAQrD2JeaMKNpn8RzjbZvT8ZZ8dohLCO4SJbrZttghs7eUoQrYG9etn3W+4 J4hQ== 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=puri.sm Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv24si2547998ejb.258.2020.09.18.09.30.06; Fri, 18 Sep 2020 09:30:30 -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=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726343AbgIRQ3J (ORCPT + 99 others); Fri, 18 Sep 2020 12:29:09 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:34772 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgIRQ3I (ORCPT ); Fri, 18 Sep 2020 12:29:08 -0400 X-Greylist: delayed 375 seconds by postgrey-1.27 at vger.kernel.org; Fri, 18 Sep 2020 12:29:07 EDT Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id DB0ADFB03; Fri, 18 Sep 2020 18:22:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WCYvx8P8Moua; Fri, 18 Sep 2020 18:22:49 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 3E70C457CC; Fri, 18 Sep 2020 18:22:49 +0200 (CEST) Date: Fri, 18 Sep 2020 18:22:49 +0200 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Colin King 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 Subject: Re: [PATCH][next] drm/panel: fix null pointer dereference on pointer mode Message-ID: <20200918162249.GA292461@bogon.m.sigxcpu.org> References: <20200918155136.28958-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200918155136.28958-1-colin.king@canonical.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks! -- Guido > > -- > 2.27.0 >