From mboxrd@z Thu Jan 1 00:00:00 1970 From: "C, Ramalingam" Subject: Re: [PATCH v9 35/39] misc/mei/hdcp: Component framework for I915 Interface Date: Thu, 20 Dec 2018 22:17:01 +0530 Message-ID: References: <1544673701-6353-1-git-send-email-ramalingam.c@intel.com> <1544673701-6353-36-git-send-email-ramalingam.c@intel.com> <5B8DA87D05A7694D9FA63FD143655C1B9DA5248E@hasmsx108.ger.corp.intel.com> <5B8DA87D05A7694D9FA63FD143655C1B9DA53C91@hasmsx108.ger.corp.intel.com> <20181217093907.GY21184@phenom.ffwll.local> <5B8DA87D05A7694D9FA63FD143655C1B9DA557ED@hasmsx108.ger.corp.intel.com> <19db4272-428a-0575-0673-2db2cd21f05b@intel.com> <5B8DA87D05A7694D9FA63FD143655C1B9DA5947E@hasmsx108.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1524554113==" Return-path: In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B9DA5947E@hasmsx108.ger.corp.intel.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: "Winkler, Tomas" , Daniel Vetter Cc: "Rafael J. Wysocki" , Greg KH , intel-gfx , dri-devel , "Shankar, Uma" , Sean Paul List-Id: dri-devel@lists.freedesktop.org This is a multi-part message in MIME format. --===============1524554113== Content-Type: multipart/alternative; boundary="------------E5FBBE101AA8967D02FC1A27" Content-Language: en-US This is a multi-part message in MIME format. --------------E5FBBE101AA8967D02FC1A27 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 12/20/2018 9:36 PM, Winkler, Tomas wrote: > +static void __exit mei_hdcp_exit(void) > +{ > +       mei_hdcp_component_cleanup(&cldev->dev); > Don’t think you can do that,  no guarantees this will be valid pointer As we discussed offline, we have the below line at cleanup. So valid pointer is made sure. I will protect init and cleanup with mutex too. +static void mei_hdcp_component_cleanup(struct device *dev) +{ +       if (!mei_hdcp_component_registered) +               return; -Ram > +       mei_cldev_driver_unregister(mei_hdcp_driver); > +} > + > +module_init(mei_hdcp_init); > +module_exit(mei_hdcp_exit); --------------E5FBBE101AA8967D02FC1A27 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit


On 12/20/2018 9:36 PM, Winkler, Tomas wrote:
+static void __exit mei_hdcp_exit(void)
+{
+       mei_hdcp_component_cleanup(&cldev->dev);
Don’t think you can do that,  no guarantees this will be valid pointer
As we discussed offline, we have the below line at cleanup.
So valid pointer is made sure. I will protect init and cleanup with mutex too.

+static void mei_hdcp_component_cleanup(struct device *dev)
+{
+       if (!mei_hdcp_component_registered)
+               return;

-Ram
 
+       mei_cldev_driver_unregister(mei_hdcp_driver);
+}
+
+module_init(mei_hdcp_init);
+module_exit(mei_hdcp_exit);
--------------E5FBBE101AA8967D02FC1A27-- --===============1524554113== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1524554113==--