From patchwork Mon Oct 24 11:27:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10054 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp622905wru; Mon, 24 Oct 2022 12:46:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5zrjZjBEe0zDVm9LSJJaiSgRO+eJLXYaX5PLTSSuYq6MSaNxCJl+Eu2ohrHYm+1GcAnvnq X-Received: by 2002:a05:6a00:3249:b0:565:fc2c:ad79 with SMTP id bn9-20020a056a00324900b00565fc2cad79mr34793855pfb.72.1666640814002; Mon, 24 Oct 2022 12:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666640813; cv=none; d=google.com; s=arc-20160816; b=seo2pziDDN/3g1vB3cWqgBi5wJW6mD+t1hxFX0QcMtJrf1n4mnat8f2keBLgvgWjBf ZSBZxbM4zttmcdQ853Yk/bBhJg3Xb9jiJs9QiFJbZTOc5VTMFzNLjsV0pN6tjyBo2Nia jya8wWBZuezLxT1VdGc4znZEyksosFhdH1VPR1zG94EF+C+sAO6FgUQpzJ5FtOcjaoAh HZAw5pUXCWAp8n37XcLbjfg0WOFwIBF283b0/Bj2yPPB7wMGCSRB6iwgO6Vpp0XitcSz 4VazVwql5S9BuU8cFygs33MM1LkFGejM7MzlMzFWe4gR/kZ4uje1QTBAmrpa4tvN3zob kQNA== 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=C8OcLkwOhi2GFnnSx7k8Jl+V3pVduoE6eJg3BznGFuM=; b=fhnksy15+HkG9nAEVp4IzsUrgUs0i8hpUTAHZPbeNwlF0+NA4M6hN9Y4ptvNtUYYFn vslPgs1RtQ1i9AbyFlbKfNluX/UzgRh+EP1pkFsyMA+fv3t1MbsiZ0B93mzo4UNc9bcC 1maa6SfS1zh66kNTrEdPLVtrtAlpr10XSqg/08t97xRjd3a29O13v6CHPIE/NxcvOjc9 nstBZEP2qrObhOWfOze88tKN9dU9WYTIFQUQmi7oaksEk5pvTJsgkBlvwMq7MNuU8fFJ 4weET00gJBfvuH1Kh39iutq15VpRPEDR1siMUGkU79kctep2bxJId+G1ehCMM+8+OFab 0wvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="y/Bfbnqi"; 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 j13-20020a654d4d000000b0046ed58fb265si402724pgt.277.2022.10.24.12.46.38; Mon, 24 Oct 2022 12:46:53 -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="y/Bfbnqi"; 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 S230185AbiJXTlH (ORCPT + 99 others); Mon, 24 Oct 2022 15:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231926AbiJXTk1 (ORCPT ); Mon, 24 Oct 2022 15:40:27 -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 C9BA01D4416; Mon, 24 Oct 2022 11:10:44 -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 9A3FDB818D2; Mon, 24 Oct 2022 12:38:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3AA7C433D6; Mon, 24 Oct 2022 12:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615096; bh=kmTfI/ZKj+I9ZDRTf5f86+c26CCEHJkW+oD1b6CuAjU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y/BfbnqijpznKo/GXjSLoZzf6pHFbGn2yYlBGuufYMfEQk1l++81VVgUF9znfUD4O bT90YFbHCC7GNNurPuYWFNdIv1aL3nFLZaaHj0FYbtF09UDAptgi/jGi/lfiPBQjC0 212SyTdouIMSgnO1xcfHBK1KMdRZqCCjvz1CFsLg= 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.15 120/530] media: cedrus: Set the platform driver data earlier Date: Mon, 24 Oct 2022 13:27:44 +0200 Message-Id: <20221024113050.475312004@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747599558028892122?= X-GMAIL-MSGID: =?utf-8?q?1747599558028892122?= 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 @@ -369,6 +369,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; @@ -440,8 +442,6 @@ static int cedrus_probe(struct platform_ goto err_m2m_mc; } - platform_set_drvdata(pdev, dev); - return 0; err_m2m_mc: