History

Merge tag 'devprop-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull device properties framework fix from Rafael Wysocki: "Prevent the promotion of the secondary firmware node of a device to the primary one from leaking a pointer (Heikki Krogerus)" * tag 'devprop-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: device property: Fix the secondary firmware node handling in set_primary_fwnode()

Linus Torvalds committed 6 years ago

Commit 005c5342 parents 0b2f18e c15e1bd1 file · +8 −4Browse files

Unified · Split

drivers/base/core.c+8−4
@@ -4264,9 +4264,9 @@ static inline bool fwnode_is_primary(struct fwnode_handle *fwnode) · 4263 unmodified lines
4264 */4264 */
4265void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)4265void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
4266{4266{
4267 if (fwnode) {4267 struct fwnode_handle *fn = dev->fwnode;
4268 struct fwnode_handle *fn = dev->fwnode;
4269 4268
4269 if (fwnode) {
4270 if (fwnode_is_primary(fn))4270 if (fwnode_is_primary(fn))
4271 fn = fn->secondary;4271 fn = fn->secondary;
4272 4272
@@ -4276,8 +4276,12 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode) · 3 unmodified lines
4276 }4276 }
4277 dev->fwnode = fwnode;4277 dev->fwnode = fwnode;
4278 } else {4278 } else {
4279 dev->fwnode = fwnode_is_primary(dev->fwnode) ?4279 if (fwnode_is_primary(fn)) {
4280 dev->fwnode->secondary : NULL;4280 dev->fwnode = fn->secondary;
4281 fn->secondary = NULL;
4282 } else {
4283 dev->fwnode = NULL;
4284 }
4281 }4285 }
4282}4286}
4283EXPORT_SYMBOL_GPL(set_primary_fwnode);4287EXPORT_SYMBOL_GPL(set_primary_fwnode);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t