From patchwork Mon Oct 24 11:29:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8867 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp433165wru; Mon, 24 Oct 2022 05:48:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xYd52NSxdl7jgy8CtX10PeSZuHxMGx76G+VX8AZiCa//8qNRu14rwT+sVkssN4CbWtoCq X-Received: by 2002:a17:903:447:b0:186:b945:c0b2 with SMTP id iw7-20020a170903044700b00186b945c0b2mr743511plb.25.1666615722352; Mon, 24 Oct 2022 05:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615722; cv=none; d=google.com; s=arc-20160816; b=tuSQ+IOU6TDssUhLyI/I5j/aC7u3Cpie/Vo03CiIAYMVZx1KqDWDj+zz1JXsQEeuKz aCLFgyNUzvqRyvmGH/tpir3byqx9NBMrQGnQsCbiIxcinYrVoHajrL5DvOcHgEP5tlps XVLutsoOpZ/wgxzYi73qm6c4s3OTZCrQFRPnRqj8STM4JuFWDSzuXhZY+HpfzDgPIoEh U2zwLUd23EDlmW7UHScDv8XA18dggeV0wO5kddXhyDVEm0hOi+bsLHif/g1SZKfXl4uW 2Ql1X20vfB6ZVahd7m7X/gHkBM/OoxRaj72KjPME8JYLexk/oS2RhTKxCpNXU8wUMe6v DwiA== 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=iCJ1YO0mDXrp2UpGwzDGOzTne2FlJmHeHqJ5p6Bw6xY=; b=UhlrWG95k2HvmTF9aN4XZjEl1WWlMvx44v4rlaKzJcAoj0MA+fMr/J/QIiaN+sTfMB avZkDb/Rt+2stvwrxN+tJ9f6k3qyHBD8Rh/zhVZ21wL5ZhbxYbgUJC56P4ASBP1OuzvS BJ+TJaw+dmnUw+YuUI0IM20bKBu3Z7gJGVMi4onOXvEoMuuba5KJCEmj6aiPAvsSLKw1 5nZc1rM79eJP40RWebUHY94e7BMGbNxhb1I53nCrBKhz4rUpFN7PXYWpnZgfOnDKbmD3 KT5ZE8jPkfgoaoUtqtWL0kUr4HRyYJnu0O9qjox3y9DEQJx/+sriK7yAyY4sziuWh2I3 dxMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V92o0Cvu; 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 oc16-20020a17090b1c1000b001f0311d12d0si10682081pjb.185.2022.10.24.05.48.28; Mon, 24 Oct 2022 05:48:42 -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=V92o0Cvu; 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 S231211AbiJXMl5 (ORCPT + 99 others); Mon, 24 Oct 2022 08:41:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234127AbiJXMjF (ORCPT ); Mon, 24 Oct 2022 08:39:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD98889922; Mon, 24 Oct 2022 05:06:54 -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 8E163612D2; Mon, 24 Oct 2022 12:06:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A316CC433C1; Mon, 24 Oct 2022 12:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613214; bh=G5rFMnbphdFlimTTrBxf0GATpB6Qn3yV8DwLPrEA5UM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V92o0Cvu9UeaO8MRSVUoeVYxRGi3mlgRWRcvPnuAH2Sg+S86gG+A9Qz/F2NnGUvaA CZITvtIi+oUqdWEPLlvWTI1r7fux1tZLNxluAluI4E8x8/iJjMbW3VGkLVHkQKNU+7 9SmeFLmQ5xRC6ii7I1tlYYmbA3uUf4Y13UGiP0LU= 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.4 051/255] media: cedrus: Set the platform driver data earlier Date: Mon, 24 Oct 2022 13:29:21 +0200 Message-Id: <20221024113004.124428205@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747573247571798789?= X-GMAIL-MSGID: =?utf-8?q?1747573247571798789?= 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 @@ -323,6 +323,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; @@ -392,8 +394,6 @@ static int cedrus_probe(struct platform_ goto err_m2m_mc; } - platform_set_drvdata(pdev, dev); - return 0; err_m2m_mc: