From patchwork Tue Nov 12 10:23:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13872063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 51493D32D8B for ; Tue, 12 Nov 2024 10:23:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BCCD410E178; Tue, 12 Nov 2024 10:23:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Q4GI9J8n"; dkim-atps=neutral Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5516810E178 for ; Tue, 12 Nov 2024 10:23:09 +0000 (UTC) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a9a4031f69fso901182866b.0 for ; Tue, 12 Nov 2024 02:23:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731406988; x=1732011788; darn=lists.freedesktop.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Ezd42G+JwcNpijWol87RV7vPAsy6HdlYEXoioaZ3yUM=; b=Q4GI9J8nn23LGpN+5eq50R6UZbinmCkciIuT4af5yDMx2jd8F0j0guB5xi5fSu67Ne /+eOjsqmnb5Gnq0viHcRusKXB4vZ5klqY5TeSaH30qGHbdzwzs4RZphY3HEq197/9b9m Dgn1XmU2uvgf+QPsT7l33mVVm4Lb9GTFnO5qDg/J2Ya6xAXPnH4uRylEdNTZ9L7paMgW bMxk11IIojjEdCiCG2gZ3Mw0Az0W5vwAwSeC+ozDq8PJT2utCNKqXW00UwHK+qKYJ2mr eGpUmhXB6uwFQIu3VDkcurlMo4DBw3fyDvfIqfiTHNzEI8NGvddT2D3rmRo248Jv+uYb P0tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731406988; x=1732011788; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ezd42G+JwcNpijWol87RV7vPAsy6HdlYEXoioaZ3yUM=; b=g838TBG+QERLwFqZ/76T+gH5ebGDBXUaZCy8pxz2EHHOOIeL3R4CNjl6UAy6oBXRvh 8c9sPm4Ge5+R82rcOAEpi+Um2+Stsji2cW6Kn4p8mAp/1TA0KJWT/+ZcXXvaTYxswGke EVfhkFeqb2DhZAolRzm6C+eBsr3akudSOoFeQliB56uZqpyEyCCzgNLW8SQoFlLbtTYM uE0J+n6k2ew8eOF0nK3KWgIcROJHc7D8zv/RHxj4Xy8hys/Sf6W/3HIpz0DEGWBNe0lv h8lhR+nLBTx4v08pd7R5HZSlg9F9GfxSsJKbiI1p6eNQATz8Q4ESCNXrNXn7drgkAnuc luUA== X-Forwarded-Encrypted: i=1; AJvYcCXELT6Gw7ftdzSdSKKrDgB1hY3OUL4wjUItVYLr2U7CTnJGoLMh4njWecILGn5i3IaSuIZAvT+A1Qo=@lists.freedesktop.org X-Gm-Message-State: AOJu0YydfxGi89oxfSnOFFPyra9zfKieKN4/jZn6O5GT987HEqfyNIJK 4uGktNG52bUpitAoBV/XGqQ2XtH4dQ1xm75SH3B/iWaRr9pE28MZ4JBvVfrpWHs= X-Google-Smtp-Source: AGHT+IGt4j9ZZSe9rgo5rLVKL7Sw0JNMnKYRedUbOwvl2VfIbz2NdhXaY+7ntI9ZFHojloYTONpjJw== X-Received: by 2002:a17:907:7d8e:b0:a9a:14fc:44a2 with SMTP id a640c23a62f3a-a9eeff44f6emr1650475766b.30.1731406987590; Tue, 12 Nov 2024 02:23:07 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9f08c9ae30sm394026966b.55.2024.11.12.02.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 02:23:07 -0800 (PST) Date: Tue, 12 Nov 2024 13:23:03 +0300 From: Dan Carpenter To: Liu Ying Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Dmitry Baryshkov , Biju Das , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH next] drm/bridge: ite-it6263: Prevent error pointer dereference in probe() Message-ID: <804a758b-f2e7-4116-b72d-29bc8905beed@stanley.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If devm_i2c_new_dummy_device() fails then we were supposed to return an error code, but instead the function continues and will crash on the next line. Add the missing return statement. Fixes: 049723628716 ("drm/bridge: Add ITE IT6263 LVDS to HDMI converter") Signed-off-by: Dan Carpenter Reviewed-by: Biju Das Reviewed-by: Liu Ying --- drivers/gpu/drm/bridge/ite-it6263.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6263.c b/drivers/gpu/drm/bridge/ite-it6263.c index cbabd4e20d3e..5f138a5692c7 100644 --- a/drivers/gpu/drm/bridge/ite-it6263.c +++ b/drivers/gpu/drm/bridge/ite-it6263.c @@ -845,8 +845,8 @@ static int it6263_probe(struct i2c_client *client) it->lvds_i2c = devm_i2c_new_dummy_device(dev, client->adapter, LVDS_INPUT_CTRL_I2C_ADDR); if (IS_ERR(it->lvds_i2c)) - dev_err_probe(it->dev, PTR_ERR(it->lvds_i2c), - "failed to allocate I2C device for LVDS\n"); + return dev_err_probe(it->dev, PTR_ERR(it->lvds_i2c), + "failed to allocate I2C device for LVDS\n"); it->lvds_regmap = devm_regmap_init_i2c(it->lvds_i2c, &it6263_lvds_regmap_config);