Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e1fb19cb
Commit
e1fb19cb
authored
Mar 14, 2016
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'device-properties'
* device-properties: device property: fix for a case of use-after-free
parents
bdeabccd
0d67e0fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
drivers/base/property.c
drivers/base/property.c
+17
-8
No files found.
drivers/base/property.c
View file @
e1fb19cb
...
@@ -218,7 +218,8 @@ bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname)
...
@@ -218,7 +218,8 @@ bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname)
bool
ret
;
bool
ret
;
ret
=
__fwnode_property_present
(
fwnode
,
propname
);
ret
=
__fwnode_property_present
(
fwnode
,
propname
);
if
(
ret
==
false
&&
fwnode
&&
!
IS_ERR_OR_NULL
(
fwnode
->
secondary
))
if
(
ret
==
false
&&
!
IS_ERR_OR_NULL
(
fwnode
)
&&
!
IS_ERR_OR_NULL
(
fwnode
->
secondary
))
ret
=
__fwnode_property_present
(
fwnode
->
secondary
,
propname
);
ret
=
__fwnode_property_present
(
fwnode
->
secondary
,
propname
);
return
ret
;
return
ret
;
}
}
...
@@ -423,7 +424,8 @@ EXPORT_SYMBOL_GPL(device_property_match_string);
...
@@ -423,7 +424,8 @@ EXPORT_SYMBOL_GPL(device_property_match_string);
int _ret_; \
int _ret_; \
_ret_ = FWNODE_PROP_READ(_fwnode_, _propname_, _type_, _proptype_, \
_ret_ = FWNODE_PROP_READ(_fwnode_, _propname_, _type_, _proptype_, \
_val_, _nval_); \
_val_, _nval_); \
if (_ret_ == -EINVAL && _fwnode_ && !IS_ERR_OR_NULL(_fwnode_->secondary)) \
if (_ret_ == -EINVAL && !IS_ERR_OR_NULL(_fwnode_) && \
!IS_ERR_OR_NULL(_fwnode_->secondary)) \
_ret_ = FWNODE_PROP_READ(_fwnode_->secondary, _propname_, _type_, \
_ret_ = FWNODE_PROP_READ(_fwnode_->secondary, _propname_, _type_, \
_proptype_, _val_, _nval_); \
_proptype_, _val_, _nval_); \
_ret_; \
_ret_; \
...
@@ -593,7 +595,8 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
...
@@ -593,7 +595,8 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
int
ret
;
int
ret
;
ret
=
__fwnode_property_read_string_array
(
fwnode
,
propname
,
val
,
nval
);
ret
=
__fwnode_property_read_string_array
(
fwnode
,
propname
,
val
,
nval
);
if
(
ret
==
-
EINVAL
&&
fwnode
&&
!
IS_ERR_OR_NULL
(
fwnode
->
secondary
))
if
(
ret
==
-
EINVAL
&&
!
IS_ERR_OR_NULL
(
fwnode
)
&&
!
IS_ERR_OR_NULL
(
fwnode
->
secondary
))
ret
=
__fwnode_property_read_string_array
(
fwnode
->
secondary
,
ret
=
__fwnode_property_read_string_array
(
fwnode
->
secondary
,
propname
,
val
,
nval
);
propname
,
val
,
nval
);
return
ret
;
return
ret
;
...
@@ -621,7 +624,8 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode,
...
@@ -621,7 +624,8 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode,
int
ret
;
int
ret
;
ret
=
__fwnode_property_read_string
(
fwnode
,
propname
,
val
);
ret
=
__fwnode_property_read_string
(
fwnode
,
propname
,
val
);
if
(
ret
==
-
EINVAL
&&
fwnode
&&
!
IS_ERR_OR_NULL
(
fwnode
->
secondary
))
if
(
ret
==
-
EINVAL
&&
!
IS_ERR_OR_NULL
(
fwnode
)
&&
!
IS_ERR_OR_NULL
(
fwnode
->
secondary
))
ret
=
__fwnode_property_read_string
(
fwnode
->
secondary
,
ret
=
__fwnode_property_read_string
(
fwnode
->
secondary
,
propname
,
val
);
propname
,
val
);
return
ret
;
return
ret
;
...
@@ -820,11 +824,16 @@ void device_remove_property_set(struct device *dev)
...
@@ -820,11 +824,16 @@ void device_remove_property_set(struct device *dev)
* the pset. If there is no real firmware node (ACPI/DT) primary
* the pset. If there is no real firmware node (ACPI/DT) primary
* will hold the pset.
* will hold the pset.
*/
*/
if
(
!
is_pset_node
(
fwnode
))
if
(
is_pset_node
(
fwnode
))
{
fwnode
=
fwnode
->
secondary
;
set_primary_fwnode
(
dev
,
NULL
);
if
(
!
IS_ERR
(
fwnode
)
&&
is_pset_node
(
fwnode
))
pset_free_set
(
to_pset_node
(
fwnode
));
pset_free_set
(
to_pset_node
(
fwnode
));
set_secondary_fwnode
(
dev
,
NULL
);
}
else
{
fwnode
=
fwnode
->
secondary
;
if
(
!
IS_ERR
(
fwnode
)
&&
is_pset_node
(
fwnode
))
{
set_secondary_fwnode
(
dev
,
NULL
);
pset_free_set
(
to_pset_node
(
fwnode
));
}
}
}
}
EXPORT_SYMBOL_GPL
(
device_remove_property_set
);
EXPORT_SYMBOL_GPL
(
device_remove_property_set
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment