Thread (13 messages) 13 messages, 3 authors, 2017-03-30

Re: [PATCH for-4.11 2/2] cfg80211: check rdev resume callback only for registered wiphy

From: Arend Van Spriel <arend.vanspriel@broadcom.com>
Date: 2017-03-28 14:46:56


On 28-3-2017 16:25, Johannes Berg wrote:
quoted
quoted
quoted
-	if (rdev->ops->resume) {
-		rtnl_lock();
-		if (rdev->wiphy.registered)
-			ret = rdev_resume(rdev);
-		rtnl_unlock();
-	}
+	rtnl_lock();
+	if (rdev->wiphy.registered && rdev->ops->resume)
+		ret = rdev_resume(rdev);
+	rtnl_unlock();
Hmm? Commit message seems ... old perhaps?
Hmmm, why? Before the patch rdev->ops was accessed before checking
rdev->wiphy.registered. When rdev->wiphy.registers is false we no
longer access rdev->ops after the patch. So a driver doing a
wiphy_unregister() can safely kfree() the callback struct after it.
Oh, right. Looks like I misinterpreted things.
So apparently my choice of words was poor. Do you want me to rephrase?

Regards,
Arend
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help