From patchwork Sat Oct 22 07:20:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1095829wrr; Sat, 22 Oct 2022 01:03:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4zqf8ooQxkp8Y0NKh+ltggeP4iHdNBtkh8uNrq3q6GK/2oEEIKOaJFxndvF3BtMcvTcjvE X-Received: by 2002:a17:90a:7c47:b0:212:ea80:8b02 with SMTP id e7-20020a17090a7c4700b00212ea808b02mr903197pjl.60.1666425816675; Sat, 22 Oct 2022 01:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425816; cv=none; d=google.com; s=arc-20160816; b=J2il3QMrEN8N1x40wvFaHdr7vT6xBlYLrtNH/h47bZuYd/6TGH5Ih8Qj1zdaLo1j10 xTJTxQWrhjkZd+ANufTnr3IRxlw9AVqGu/vcwj+l5cFMF5c/Gx4AyRX10YdheO8Y0fdT QWwzblhkfvgsnciZoiza16I5zQfrLklM2eQjmeviIrXc4JqyqXnQUVBfiKltW0UNVu7d injPV9StBzusVUsvlb6yU44eSw9Iu8jv3UAcxn8PzbJQ5bawEMvXmgZUXUhK6r0FgBNZ 7mNpXZWuPZV5OCKfwKuMEcwx6mqS5CICs/o9YptvWPgbRe5QJKkaVPGBcjqsUahACR8U Q6ag== 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=o/XWI/r91UXBR2OOaY3Ku8PUeov57qvXoRyLStnAO2c=; b=ALGGKrhZVvtz0cZNuzxN0BOlNG0rFD4NRQqInXSmd0R/7FlMZoGJlOg857aRFg/DSL L0m5/WhxbJAQew84E0qolQrVeqm+CBF7+UL8lm+N9j0rfC+CgMINh8wXHbASi1m7joe7 2VgaOAMv5FOkJLddhShUDWvB5dX6537safQlv9C/XzA1+TwWtTEw6/qdN9m+icDUy5l4 CEOKZO7wMN6qS8Rmz/+01DKy/GBFcj9d80V8oBPY27HOgulmDXw0CJTmLYveDj4WpFlz UOsobF4NPH9MXhDH8yWMhLgjQHdm9H9MpO7niyTW16ccoEdCZOXoOfWbbmMSmPV6YH1d Zz7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bPRgF89v; 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 pq8-20020a17090b3d8800b0020382775a6fsi8176781pjb.149.2022.10.22.01.03.23; Sat, 22 Oct 2022 01:03:36 -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=bPRgF89v; 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 S232624AbiJVIDB (ORCPT + 99 others); Sat, 22 Oct 2022 04:03:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232383AbiJVHyw (ORCPT ); Sat, 22 Oct 2022 03:54:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CF412CA7E5; Sat, 22 Oct 2022 00:47:51 -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 dfw.source.kernel.org (Postfix) with ESMTPS id EC29360B80; Sat, 22 Oct 2022 07:41:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D519C433D6; Sat, 22 Oct 2022 07:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424466; bh=7Xwy95C2E5ageYfL4Q4GKPlKhQLwTN2ZgccIzHpijL0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bPRgF89v7WGnfNYGplHhZY5tQdaXBFAGH++YJOJppqMKqgmuRR3/XWL7cMsa3DLfW STxIbBSAE5y4uj+JGs4u0fYZVREIH56vqYwDLa17hFsIQTGLNCwGX42QD+VEgvXmTU JqhOXjry37N2UBWJGRqdysVndJEe7bXK7Ny3MuKs= 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 5.19 156/717] media: cedrus: Set the platform driver data earlier Date: Sat, 22 Oct 2022 09:20:35 +0200 Message-Id: <20221022072443.055235337@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747374117438611977?= X-GMAIL-MSGID: =?utf-8?q?1747374117438611977?= 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 @@ -422,6 +422,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; @@ -495,8 +497,6 @@ static int cedrus_probe(struct platform_ goto err_m2m_mc; } - platform_set_drvdata(pdev, dev); - return 0; err_m2m_mc: