From patchwork Wed Oct 19 08:24:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp299341wrs; Wed, 19 Oct 2022 05:32:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM49KSn78Kg4/R8nTJ2h2eILMqa+esm8AtDFSbvjG136DF1mzgYmmL/+dsA0rhU9qV4j2RSr X-Received: by 2002:a17:906:591:b0:73d:c3ef:84ae with SMTP id 17-20020a170906059100b0073dc3ef84aemr6564178ejn.155.1666182724319; Wed, 19 Oct 2022 05:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666182724; cv=none; d=google.com; s=arc-20160816; b=eR+SwkT4JWYAuVc31rQ3x4ZFVNWFEao+pqN5P9uUh761owV0GG1ZP+LHrgAvKXeBko xmAnDUijPrbu82W/jCgNctbydj+H6EPIQOki0REyrAWeWdgOu515+eHTVgT/asI16E+H o8OSyQSB+HfF0ceH3NmCh+7o4AQSCaUoebZOCXM/jBoWYpuMCah4DcolZnaagc/wpqvp NnBfhvkIkTxBwcoVZyFABijL0neZrvdDMr276O3gDYXsnepCGpx86jPI64WFjHFEXX+a h90K7IbZicumkKuzi0hksKDx0SyxhIFZNvzeznfzq7KW1odQKU9YKsSpi6/LCzFlUSeC ABSg== 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=325R1WyLc+2+qwvhPvkdzq9eWRT25C6jz+lGv98ZAHk=; b=o5Xp0WeV2zGTq4KHfGOb5WgNp7QLak1ejyroV8ghVYBuJzMQhaOcSzkFZaQE5oJxyO UiTsi1zJUeGtXtabGFvF9GqG7wVmhJQY9xpo4aShYtLtj4OQmsD2lmQfiTOVrurf55lS U+Z8Z9gMYn2ZPf+nksR0u8tHE4SZwx5NspPlDPBtE4IIOyKrbUQgZryE2Sdz+gNvjTZX n4EG8qjk/N0Pk14qyTnV/qFDgI+8vGf27dJbL2S8/TMru4xoEBC2hjrnmtJc48yPeZAH 34FGidcpWFmwXJfx5C1fAY4KgzTNHVvqAEl8dcz6MB26gvupvIhLOPHEyCdOw3i7WVNN ZO4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PijNbsh6; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a056402254b00b0045d4b7ad162si11873562edb.546.2022.10.19.05.31.38; Wed, 19 Oct 2022 05:32:04 -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=PijNbsh6; 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 S232068AbiJSMTz (ORCPT + 99 others); Wed, 19 Oct 2022 08:19:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233121AbiJSMTE (ORCPT ); Wed, 19 Oct 2022 08:19:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B60BE1D67C; Wed, 19 Oct 2022 04:54:28 -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 3A516B82312; Wed, 19 Oct 2022 08:45:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CBEDC433D6; Wed, 19 Oct 2022 08:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169136; bh=jg4ohn3/1jVyZ03iJkHbsTt2BOLdGqdLWdeUndyq9E0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PijNbsh6PjC6zD3jcv433tEkVqMZfLab3Fs2Azw8esvOkVJIvwZb82ByyIvVvxn+I TD87vMS0Y1JItZzxq4VkCXP2V5xelM0j3bIi0q9/KNLrlVSsrVUx8pdMC0waxLz7OU iFdoNeeSxeE/Dc9TDm3pLs2hpRZyDmsS6j03+IJY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Osipenko , Nicolas Dufresne , Samuel Holland , Paul Kocialkowski , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 6.0 170/862] media: cedrus: Set the platform driver data earlier Date: Wed, 19 Oct 2022 10:24:17 +0200 Message-Id: <20221019083257.464093108@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747119216327018749?= X-GMAIL-MSGID: =?utf-8?q?1747119216327018749?= From: Dmitry Osipenko commit 708938f8495147fe2e77a9a3e1015d8e6899323e upstream. The cedrus_hw_resume() crashes with NULL deference on driver probe if runtime PM is disabled because it uses platform data that hasn't been set up yet. Fix this by setting the platform data earlier during probe. Cc: stable@vger.kernel.org Fixes: 50e761516f2b (media: platform: Add Cedrus VPU decoder driver) Signed-off-by: Dmitry Osipenko Signed-off-by: Nicolas Dufresne Reviewed-by: Samuel Holland Acked-by: Paul Kocialkowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/sunxi/cedrus/cedrus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/staging/media/sunxi/cedrus/cedrus.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c @@ -448,6 +448,8 @@ static int cedrus_probe(struct platform_ if (!dev) return -ENOMEM; + platform_set_drvdata(pdev, dev); + dev->vfd = cedrus_video_device; dev->dev = &pdev->dev; dev->pdev = pdev; @@ -521,8 +523,6 @@ static int cedrus_probe(struct platform_ goto err_m2m_mc; } - platform_set_drvdata(pdev, dev); - return 0; err_m2m_mc: