Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp865029rwb; Thu, 18 Aug 2022 13:47:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR508qgLIC32r64KsoznC6M3IicyYs6l24hoi7tgBgUwK5GQibviiptMzofGkXDxwN3iEsw7 X-Received: by 2002:a63:6116:0:b0:41c:680b:f18d with SMTP id v22-20020a636116000000b0041c680bf18dmr3566088pgb.423.1660855648474; Thu, 18 Aug 2022 13:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660855648; cv=none; d=google.com; s=arc-20160816; b=o/8a/5lyeKu5w3mQAU1Yzonud8Vs/6jJBdYy7o1mtohnkQ6HTszpppaYgVlRBksbVZ RPhOZE7ISqM5elbHxMtC0o+CryDZUP8OyWSnN1Y0/wN4bCQL6v0s6P8iAz6NF3nosMzk p0Je46vag2eGKOnPpIvOCn+yHvL9EFzpZzivTYXdbklwy62hbUOu5ZRUaRWmnUuYPuXL x6uxDMm2Y8GZ4dtwMjf6q63Zz87XzbIF05+cS4CXQ0jqja6jX3C8CCLrIW6nHmgyXOfa ozyn9aNOwwI/EHr/HQv23J93sve1VgYT5j8QhDVgP0R103vK0Rr5nne0O4r6KavHIE76 ZgqA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=G+awriujDGQ4X4BvK/Hy1QDYxs2Kbuul0t9IsjXtm1A=; b=fUwyTC5mNVGpy35YEW2/tVgoNoV+HIbY5h8TPCRS4LwwDTwKcIJSxW40uY6TjT/0ya uqpsPEA3EKcYYBJzAb7mdYR0Y8zkzdq2U6PETD1LXJXsdraIlC29b+XLC9ZSOW/w4bAK 8fzKmLX0wfmEAwbOvKSrQeW/p0sH1IFi1QcYFgNvBqPhg+oOiOZasrQ8EihkQWeFeDVF zIK0Iq5OQfQTIpSsMvcxDCQIVu2/mxQvNMSipiwfrLTe/xjcdOMZbYZYAqUtQKsSRLBA aYCTCNW2NGGCFP/jPXdPrR2Wo/yQrFvfpD6TXtWb0ldUzSjjx5sAKA1xnbFPNBKkqVb7 iaGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Yo6EbmMs; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b22-20020a630c16000000b00427bbed9768si1969003pgl.75.2022.08.18.13.47.14; Thu, 18 Aug 2022 13:47:28 -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=@collabora.com header.s=mail header.b=Yo6EbmMs; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346098AbiHRUd7 (ORCPT + 99 others); Thu, 18 Aug 2022 16:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346091AbiHRUd6 (ORCPT ); Thu, 18 Aug 2022 16:33:58 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9F3F3C8F9; Thu, 18 Aug 2022 13:33:56 -0700 (PDT) Received: from whitebuilder.lan (192-222-136-102.qc.cable.ebox.net [192.222.136.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9106A6601B7A; Thu, 18 Aug 2022 21:33:53 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1660854835; bh=hvEiAvpDFVVSoBAQ52gtXwVxHayJqh7AhxJnyUuWZII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yo6EbmMswKJNtgeL+rG3yxayMi3H8ZSeZRYASO4kAqFDuxN3l3Ka30qQpubYUGgwc 6bAbT8UosuDfp30uy4kGhil39cvLZTnCkhfmVPqoCVfshyhIlmcvunEeU7yrTXaWrk SUo1ns8Fz/YomVGR3o501y17WiWZBSot5PRmVP2tUZn2Wn+wqwccGOHGHf17+PBQjd gFw10zuG5qGqZOfA+S6Ltn9LkPlamcg63+EATVJ4Ee4a4pJhGWsElLHTlenrSFlnnW JaKDEqlydcRNE0hQe3E5+RDkpQN8+K6oJW3bpFKgzmS1tRklppRZpl8ADQYoAVjUav yQ+jsc1Vk2f7Q== From: Nicolas Dufresne To: linux-media@vger.kernel.org, Maxime Ripard , Paul Kocialkowski , Mauro Carvalho Chehab , Greg Kroah-Hartman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: kernel@collabora.com, Dmitry Osipenko , stable@vger.kernel.org, Nicolas Dufresne , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/3] media: cedrus: Set the platform driver data earlier Date: Thu, 18 Aug 2022 16:33:07 -0400 Message-Id: <20220818203308.439043-3-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220818203308.439043-1-nicolas.dufresne@collabora.com> References: <20220818203308.439043-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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 Signed-off-by: Dmitry Osipenko Signed-off-by: Nicolas Dufresne --- drivers/staging/media/sunxi/cedrus/cedrus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c index 960a0130cd620..55c54dfdc585c 100644 --- 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_device *pdev) 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_device *pdev) goto err_m2m_mc; } - platform_set_drvdata(pdev, dev); - return 0; err_m2m_mc: -- 2.37.2