Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3888489rwi; Sat, 22 Oct 2022 01:36:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM60iB3XSADE7qo3HfvBzHbalVTFU+Ih8PuJmppvY+AbXxNNbAqqpEEmACJT+JYPsXLJ39R0 X-Received: by 2002:a17:907:a42c:b0:78e:fd1:61b4 with SMTP id sg44-20020a170907a42c00b0078e0fd161b4mr19632371ejc.289.1666427787189; Sat, 22 Oct 2022 01:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427787; cv=none; d=google.com; s=arc-20160816; b=GOxXf3qyAeNQAK+dizs3O9Y4D2F57b5JEnr5l84XwsU3q9VMf1ef/XUrxxFBWyOilZ WsprjuEWrG8QOTX3rYrVvkiES1XvQV4NX3B8nT9kAg/prDGX4FGHmvkyQAshYdso35cE qBnRm7mYA5SHkEIqH736ntmCLPuvswhPqrKa8hDRh0X2K24p12WROQRUW7OxO1ZTArNl wlFnXszW87U6T5Tm1Ii7mbuWr9duQquulAIh60+z7s8333Qf5eYGMtxwa9Yjku93+6n3 lEH38RGfasEN08fc3AKyC3p2AEgZExyllYE0S8t9Sdka1e1RhG9fO1vfE7oUOpG/LVhA A8eQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a05640227d400b0045d27c0ba90si23418541ede.577.2022.10.22.01.35.56; Sat, 22 Oct 2022 01:36:27 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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: