From patchwork Mon Oct 24 11:27:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9669 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp534946wru; Mon, 24 Oct 2022 09:12:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79wIeRuFHMbgyzuKkvc1nSeAsj2O46CmCBYBBXSTHuEsZFKmDqEQLvV7Al5pVHgYD7W3Dt X-Received: by 2002:a17:90b:1c82:b0:1ee:eb41:b141 with SMTP id oo2-20020a17090b1c8200b001eeeb41b141mr40663297pjb.143.1666627926400; Mon, 24 Oct 2022 09:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627926; cv=none; d=google.com; s=arc-20160816; b=QO1rYu9wo6zzKWW9vL2VdNM4faZjMXCXUCnHKDm+SOA4+lBls/GnXdeaMZg/MrvOgD 1kxSRndtoKVlGlWsVFqnvRKQNPsYSDtgG8dqDjrimOC0+wMOGt0bnvQqt4J4CteN5gMH ZvkYTCd7FDE1Qg7WSTyV2yNomgFkI8KjWhKLMOsWViSlr1udkYs5EzZ0YZ88nCR/GYHt +ak8HbeABvyns/hdRpry9eBhbH0l+/mSn2/2BWFJiI+zggsSKPmA4l79M7loQPpnn8e5 MDp4C+0gdqzPg+zjNOpyVITJcHIEqCs24+MPGNHvz+HdYgpNPOmbOJxQnnay2AckKCeC g3qA== 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=s+zfwSn/Qv1etNEHoGqgi1JPj2GjbHvlDzWrqsLI/Fg=; b=jVCB8vrpHh+l200f/FsnZ7QoebxqwBVx1uApdXaC58CcNeSDv4mn6ZMz8HyLeN4SlA B2+bWAZ+fBtLHKxpWP0xRYK7OPexQcCQwVFefLal9pe35i4EXLr4rVP7q8W+XSnszgVr 0UAuUb8dgd62ThWo3l0OvB5d2k5VgGEzbyiRL/fZ71255RLYxZRVGu4z3tIkQKgya9++ BLoaz2NGGDPi+re7EBkaeQOTR/A2MNkcvxsHd+sg8lYidnaB9Sz+2wBWxj4+rW6Bo4j+ DQ9fgFnF6OXKGpYUYgL93X8vUjmjAACjCblY6De5Ma5Apz49zlylfCHv7ZKwuw6NoOGR iPrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BMcGcqvx; 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 j190-20020a6380c7000000b0046ecd36adbasi10335023pgd.635.2022.10.24.09.11.52; Mon, 24 Oct 2022 09:12:06 -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=BMcGcqvx; 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 S233524AbiJXQLS (ORCPT + 99 others); Mon, 24 Oct 2022 12:11:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233881AbiJXQFJ (ORCPT ); Mon, 24 Oct 2022 12:05:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C7D621275; Mon, 24 Oct 2022 07:57:58 -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 3580FB8163D; Mon, 24 Oct 2022 12:19:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 896E8C433D6; Mon, 24 Oct 2022 12:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613984; bh=yQxYSUD1p+TOWduy77WsLk9SCj0jFWYR+4HO5HkbBW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BMcGcqvxRjJxya4MgpWyfHZynGFeM7hwhB9fQ4Q2ymsbpRFGmWqDWtd4yK9B6yqjz VbkBbjbGHbieCviW69P9KL3DTGfgwreD8q0BfBXE3WKaDYj3laq35ccWF3hB3kUJWz 51yf5VsS8cTu38Z1d4oDx01TgkBBDgm/NlMyZaYU= 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.10 081/390] media: cedrus: Set the platform driver data earlier Date: Mon, 24 Oct 2022 13:27:58 +0200 Message-Id: <20221024113026.064484686@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747586044345897158?= X-GMAIL-MSGID: =?utf-8?q?1747586044345897158?= 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 @@ -399,6 +399,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; @@ -469,8 +471,6 @@ static int cedrus_probe(struct platform_ goto err_m2m_mc; } - platform_set_drvdata(pdev, dev); - return 0; err_m2m_mc: