From patchwork Wed Sep 4 18:55:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 11131241 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E96314E5 for ; Wed, 4 Sep 2019 18:55:45 +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 EAD372087E for ; Wed, 4 Sep 2019 18:55:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAD372087E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com 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 5871989C25; Wed, 4 Sep 2019 18:55:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1ECD589C25 for ; Wed, 4 Sep 2019 18:55:42 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x84ItN8f056173; Wed, 4 Sep 2019 18:55:23 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2utjvt010w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Sep 2019 18:55:23 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x84IrR9v114298; Wed, 4 Sep 2019 18:55:19 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2ut1hnxvbn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Sep 2019 18:55:19 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x84ItFOC029349; Wed, 4 Sep 2019 18:55:15 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 04 Sep 2019 11:55:14 -0700 Date: Wed, 4 Sep 2019 21:55:07 +0300 From: Dan Carpenter To: Thierry Reding , Laurent Pinchart Subject: [PATCH v2] drm: panel-lvds: Potential Oops in probe error handling Message-ID: <20190904185507.GA3634@mwanda> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190904115057.GC4811@pendragon.ideasonboard.com> X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9370 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909040189 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9370 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909040189 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=mPi6nO703By+X80rHKGWRdzW+XBHf89rfMGiRteKjEQ=; b=m9oJvPqBN9hxgtRUeQ2t91oqn7RJ0kjkqXsRE8iprSaSC0bXMFySr4qxRnszfr9LmXhV LECf5d9VqSYPTbGu9MNtFhZe60l8I/tWOgYJXInmqjxENNURXy6DG7BiV4lOclz2Tukh h6f60ws2Y7pkbSuueOkQ4z8FZ4+IQZDilaL6KxFiWuII29ByGnnIXiKnEcxIHecDzs/4 kIETbZG72btaZScZj7kzIRclANeD236LDqo7ak8dROgP0bH5R9Vm2aUr9enwjm+mS3Sl YYVreNFDngVYOdS8uZwDQNMDVNIxx5FV3J/lPgoBup9JK7HC4WtuUdDXMlYOmKdlEK3y gw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , kernel-janitors@vger.kernel.org, Liam Girdwood , dri-devel@lists.freedesktop.org, Mark Brown , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The "lvds->backlight" pointer could be NULL in situations were of_parse_phandle() returns NULL. Also it's slightly cleaner to use backlight_put() which already has a check for NULL built in. Fixes: 7c9dff5bd643 ("drm: panels: Add LVDS panel driver") Signed-off-by: Dan Carpenter Reviewed-by: Laurent Pinchart --- v2: Use backlight_put(). Thanks, Laurent! drivers/gpu/drm/panel/panel-lvds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index ad47cc95459e..05e8885db7ed 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -272,7 +272,7 @@ static int panel_lvds_probe(struct platform_device *pdev) return 0; error: - put_device(&lvds->backlight->dev); + backlight_put(lvds->backlight); return ret; }