From patchwork Mon Oct 9 08:44:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 115185 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2304965qgn; Mon, 9 Oct 2017 01:44:17 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDMQoRXIdneLIlJN/VvW8dlPJuBYj5RGMOKnSgCMdnRRPbHBw4rj8MzhWh71wOr32SJ48dQ X-Received: by 10.98.223.15 with SMTP id u15mr9519368pfg.115.1507538657304; Mon, 09 Oct 2017 01:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507538657; cv=none; d=google.com; s=arc-20160816; b=RwLBSGvZ3gniSoX1FWcr4hxEyBKmT3Q0tHZVDsdmZNH1y2/SLy0FB2BhiuBBVN6Vdg O7hyccWIyIiouSKXsVfqPp4CWe1PoyxC28rtpisLeVGXKdFBTLvH24NbhZdTFTOASfeO QXRIyVF/7yDh9JyG8aTTW9z611gYjvdO8PvNprrHcKnj5sDuFobZVEx7wlB1MXqOSvBy PZP3swgO5e6+9842//TZeAdA/nZ38/pgFSSH4p3v2u7O672dqnqXb+lTuxtcYCaIlnq5 o1nowKbpbHfa84pHAVaFXHuGTUCM5wn/3cqXf2Zoa4SkcBdJAVL4cO+yFrSAzoMcnlK5 av4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:arc-authentication-results; bh=NzR35l5Zx3cVWgd21qY+AOeXBuh5pplEi2nfcOj+J68=; b=y2x8x6sJjfqdOAtB+xihUCaKvuzoMxnlpgjnKUCnPAt00W5bdANhtng58WR4+V13q5 QthA2YUZFSlKcU6v/AFnG3Fu1jFU1Wm2tnZUFmwkXxBaWUoT3++KT/V8sontiTnql679 41LOVQV+Rjiiay/mDNkoIhQ2HtUWAErtEwc7N9WR2J9qe1tJo+CquEt4dmM+17EKy3ui HGRA8vtx0ofjboY3XoeaGec/5W74pa9aKqreYp+8pRBcloAfGaqj21Akfdjt9YVZqN5y TKO9fe0CkYVJfXrPwerb/XtiaDwrYL66POTbPi8vVFBU2DZIGaq55pSvzcyCNng9zqYH ZFEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si6560109pfd.123.2017.10.09.01.44.17; Mon, 09 Oct 2017 01:44:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750930AbdJIIoQ (ORCPT + 4 others); Mon, 9 Oct 2017 04:44:16 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:40982 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbdJIIoP (ORCPT ); Mon, 9 Oct 2017 04:44:15 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20171009084413euoutp01f03371ad64788efbabd3d08003108520~r2msGmeZe1557715577euoutp01G; Mon, 9 Oct 2017 08:44:13 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20171009084412eucas1p1dcdcb7cc493bdebb8cef1478e1ff78e4~r2mrcsFXI1446514465eucas1p1n; Mon, 9 Oct 2017 08:44:12 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 86.03.12576.CD63BD95; Mon, 9 Oct 2017 09:44:12 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171009084411eucas1p213cce9d027a1861d3c96ce99837a6fb0~r2mqs9TTq3182531825eucas1p2K; Mon, 9 Oct 2017 08:44:11 +0000 (GMT) X-AuditID: cbfec7ef-f79ee6d000003120-7f-59db36dc61f1 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 7F.AD.18832.BD63BD95; Mon, 9 Oct 2017 09:44:11 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OXJ00894S9K0270@eusync4.samsung.com>; Mon, 09 Oct 2017 09:44:11 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Andrzej Hajda , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH] drm/exynos: Clear drvdata after component unbind Date: Mon, 09 Oct 2017 10:44:01 +0200 Message-id: <20171009084401.7237-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.14.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsWy7djPc7p3zG5HGvRvUrC4te4cq8XGGetZ La58fc9mMen+BBaLF/cuslicP7+B3WLG+X1MFmuP3AWyJr9kc+D02LSqk83jfvdxJo++LasY PT5vkgtgieKySUnNySxLLdK3S+DKuHn5CnPBY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em5xYb6hUn5haX5qXrJefnbmIEBsy2Yz8372C8tDH4EKMAB6MSD2/DtFuRQqyJZcWVuYcY JTiYlUR4PxrdjhTiTUmsrEotyo8vKs1JLT7EKM3BoiTO27tndaSQQHpiSWp2ampBahFMlomD U6qBcc7upZrFe5o+yj/jnZWXtNjLY59R0KTHVdId5Y0pDHLvneLl+96EZ2x6bLtCrI/7zKa/ Hz7WpG1+kLxjLesM1yu1zIHXZ57v5klbsCCkuW/erI/nvX+0nvm3QuHpd/P+D4tXOb2d8bn1 xISj6vf26t5RE+ngl571Y5GN7xJP7Zhv8U6xl80vciqxFGckGmoxFxUnAgD/fxYnFAIAAA== X-CMS-MailID: 20171009084411eucas1p213cce9d027a1861d3c96ce99837a6fb0 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-CMS-RootMailID: 20171009084411eucas1p213cce9d027a1861d3c96ce99837a6fb0 X-RootMTR: 20171009084411eucas1p213cce9d027a1861d3c96ce99837a6fb0 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org When components are unbound, DRM driver is unregistered and freed, so clear drvdata to avoid potential use-after-free issue in suspend/resume paths. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 + 1 file changed, 1 insertion(+) -- 2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index aa770bb0153c..82b72425a42f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -430,6 +430,7 @@ static void exynos_drm_unbind(struct device *dev) kfree(drm->dev_private); drm->dev_private = NULL; + dev_set_drvdata(dev, NULL); drm_dev_unref(drm); }