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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FC14C433E2 for ; Fri, 4 Sep 2020 07:47:09 +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 49575206A5 for ; Fri, 4 Sep 2020 07:47:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49575206A5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sigxcpu.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 56F056EB1D; Fri, 4 Sep 2020 07:47:08 +0000 (UTC) Received: from honk.sigxcpu.org (honk.sigxcpu.org [24.134.29.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F0BB6EB1D for ; Fri, 4 Sep 2020 07:47:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 2331BFB03; Fri, 4 Sep 2020 09:47:03 +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 e_2jAfQnGV8S; Fri, 4 Sep 2020 09:47:02 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 2AF5945B81; Fri, 4 Sep 2020 09:47:02 +0200 (CEST) Date: Fri, 4 Sep 2020 09:47:02 +0200 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Dan Carpenter Subject: Re: [bug report] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel Message-ID: <20200904074702.GA124270@bogon.m.sigxcpu.org> References: <20200831112924.GA512743@mwanda> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200831112924.GA512743@mwanda> 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: , Cc: dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, On Mon, Aug 31, 2020 at 02:29:24PM +0300, Dan Carpenter wrote: > Hello Guido G=FCnther, > = > The patch 72967d5616d3: "drm/panel: Add panel driver for the Mantix > MLAF057WE51-X DSI panel" from Aug 17, 2020, leads to the following > static checker warning: > = > drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c:205 mantix_get_modes() > error: we previously assumed 'mode' could be null (see line 204) > = > drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c > 197 static int mantix_get_modes(struct drm_panel *panel, > 198 struct drm_connector *connector) > 199 { > 200 struct mantix *ctx =3D panel_to_mantix(panel); > 201 struct drm_display_mode *mode; > 202 = > 203 mode =3D drm_mode_duplicate(connector->dev, &default_mode= ); > 204 if (!mode) { > 205 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", > 206 default_mode.hdisplay, default_mode.vdisp= lay, > 207 drm_mode_vrefresh(mode)); > ^^^^ > This will lead to a NULL dereference. Thanks, i'll fold a fix for this into some other upcoming changes to this driver. Cheers, -- Guido > = > 208 return -ENOMEM; > 209 } > 210 = > 211 drm_mode_set_name(mode); > 212 = > 213 mode->type =3D DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFE= RRED; > 214 connector->display_info.width_mm =3D mode->width_mm; > 215 connector->display_info.height_mm =3D mode->height_mm; > 216 drm_mode_probed_add(connector, mode); > 217 = > 218 return 1; > 219 } > = > regards, > dan carpenter > = _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel