Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3540835ioa; Tue, 26 Apr 2022 05:44:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxf7epjpRPc+EsfczoGlXTXOK8IXj1K1Ck06Adp4WDid2OHty/isxtkFxPLC5HJKj5h5dj+ X-Received: by 2002:a17:906:fad6:b0:6f3:9ea7:1d49 with SMTP id lu22-20020a170906fad600b006f39ea71d49mr7430661ejb.635.1650977097796; Tue, 26 Apr 2022 05:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650977097; cv=none; d=google.com; s=arc-20160816; b=fC4F7NMpOuYAxoAIMghyOwFBcthk6kksrtAZ/C5wkzbu27YfVEoh2BcF1tFIiEpP/R sz4ZdxmwiB7aYclikQlFPd4LKiMoGgJAVX3JjzHNJ9T+rycT/6l9eM9FosWJDi4kKFZH cLl0iKJmDYPZ9VgnBiEoq6DxJ+5n5tyPH3kfIWYyIVVlx+zC+SEACqHux/7iE1OXKbTD JRlsgXaK0x7SMVsCxSpVAgt546r01LdbznKHuz0zulBQJLdjn57CO13E3aC8YvuEa6Sn l/4i1b3jPO/ELA+F12wr5S7DBL0JJK1AvQoc/+YhRkhpZwpk8Fn6ER4sXvQgzuztMsP0 DXGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=a+9O/YakQVyss4mQ52hTn37Fl6J719aYj2+9ipQm2rE=; b=yN2tbrP1h4GH25w6St1LMo1Za+018PWiHN9G6DrMO/o8cvr137XCIp1bkYCoVX0bf6 zPfc6CVd3DbbxH9JyILl1S4sOrrQDpeHyQG0AZbrmYumiI2AnJaKfWJGFDxVWxKaWfnZ UnpW0sdZoCWwT/ZJUSf5iJqXqM46hTfDpZBfuT7tp03lyUZnaZZxdIU2MslhADkg9fD1 5zS2Jr0kUqGW5J8o4Epf56Vo3SQrGeZKc+9cPyyBfxtPtrU+rB+qaYHfrnqYpAcyqKu8 rpsFIN194GhegZEkQIpy9g1Z/7brnye8o7wAUxPvKjLW75NDr+WtusCUZz5+Z4ok605k 0clg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="bsze/IAG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb14-20020a0564020d0e00b00418c2b5be01si17158645edb.227.2022.04.26.05.44.33; Tue, 26 Apr 2022 05:44:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="bsze/IAG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234230AbiDZJMg (ORCPT + 99 others); Tue, 26 Apr 2022 05:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347505AbiDZIvl (ORCPT ); Tue, 26 Apr 2022 04:51:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D130626F; Tue, 26 Apr 2022 01:40:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A0091B81CF2; Tue, 26 Apr 2022 08:40:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1306EC385A0; Tue, 26 Apr 2022 08:40:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962419; bh=1VoSaBJwo6TdKIU4fRmW1G6i+TLa8PraiX9ok07uIxI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bsze/IAGz/76XiXp8N7GIV2CAZ9NnxtX9j7387wT6lCgO/y3yqliExzxGBY2he6wz vsYxoNhttCQlduU440RQjlK5jMsEgAKw3sKoWBy7R7tWF8s4mDEmHoQVpna79+taot EYJbYzmsIMhMS62ad4RN+NjB3OEUkYiUhCxQ95Ro= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Stevenson , Stefan Wahren , Maxime Ripard , Sasha Levin Subject: [PATCH 5.15 091/124] drm/panel/raspberrypi-touchscreen: Avoid NULL deref if not initialised Date: Tue, 26 Apr 2022 10:21:32 +0200 Message-Id: <20220426081749.886588218@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Stevenson [ Upstream commit f92055ae0acb035891e988ce345d6b81a0316423 ] If a call to rpi_touchscreen_i2c_write from rpi_touchscreen_probe fails before mipi_dsi_device_register_full is called, then in trying to log the error message if uses ts->dsi->dev when it is still NULL. Use ts->i2c->dev instead, which is initialised earlier in probe. Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.") Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220415162513.42190-2-stefan.wahren@i2se.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c index 46029c5610c8..1f805eb8fdb5 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -229,7 +229,7 @@ static void rpi_touchscreen_i2c_write(struct rpi_touchscreen *ts, ret = i2c_smbus_write_byte_data(ts->i2c, reg, val); if (ret) - dev_err(&ts->dsi->dev, "I2C write failed: %d\n", ret); + dev_err(&ts->i2c->dev, "I2C write failed: %d\n", ret); } static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val) -- 2.35.1