software nodes: Fix use of potentially uninitialized variable
Subsystems (2)
Heikki Krogerus
reviewerv3 cover software nodes: Fix use of potentially uninitialized variable
Hi,
The patches now have a bit better commit messages (hopefully).
Rafael should take these since the patches that these fix are in his tree.
thanks,
Heikki Krogerus (2):
software node: Initialize the return value in
software_node_to_swnode()
software node: Initialize the return value in
software_node_find_by_name()
drivers/base/swnode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.23.0.rc1
Heikki Krogerus
reviewerPATCH v3 1/2 software node: Initialize the return value in software_node_to_swnode()
The software node is searched from a list that may be empty when the function is called. This makes sure that the function returns NULL even if the list is empty.
--- drivers/base/swnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/swnode.c +1 -1
@@ -51,7 +51,7 @@ EXPORT_SYMBOL_GPL(is_software_node);static struct swnode *software_node_to_swnode (const struct software_node *node) { -struct swnode *swnode; +struct swnode *swnode =NULL ;struct kobject *k;if (!node)
Signature · 1 line
2.23.0.rc1
Re: [PATCH v3 1/2] software node: Initialize the return value in software_node_to_swnode()
Quoted 8 lines · Heikki Krogerus
The software node is searched from a list that may be empty when the function is called. This makes sure that the function returns NULL even if the list is empty.
Fixes 80488a6b1d3c ("software node: Add support for static node descriptors")Reported-by kbuild test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Heikki Krogerus <[email protected]>
Re: [PATCH v3 1/2] software node: Initialize the return value in software_node_to_swnode()
Quoted 6 lines · Greg Kroah-Hartman
Quoted 4 lines · Heikki Krogerus
The software node is searched from a list that may be empty when the function is called. This makes sure that the function returns NULL even if the list is empty.
Quoted 6 lines
Quoted 4 lines
Fixes 80488a6b1d3c ("software node: Add support for static node descriptors")Reported-by kbuild test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Heikki Krogerus <[email protected]>Reviewed-by Greg Kroah-Hartman <[email protected]>
Applied, thanks!
Heikki Krogerus
reviewerPATCH v3 2/2 software node: Initialize the return value in software_node_find_by_name()
In reply to Heikki KrogerusThe software node is searched from a list that may be empty when the function is called. This makes sure that the function returns NULL if the list is empty.
--- drivers/base/swnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/swnode.c +1 -1
@@ -722,7 +722,7 @@ static const struct fwnode_operations software_node_ops = {const struct software_node *software_node_find_by_name (const struct software_node *parent,const char *name) { -struct swnode *swnode; +struct swnode *swnode =NULL ;struct kobject *k;if (!name)
Signature · 1 line
2.23.0.rc1
Re: [PATCH v3 2/2] software node: Initialize the return value in software_node_find_by_name()
Quoted 8 lines · Heikki Krogerus
The software node is searched from a list that may be empty when the function is called. This makes sure that the function returns NULL if the list is empty.
Fixes 1666faedb567 ("software node: Add software_node_get_reference_args()")Reported-by kbuild test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Heikki Krogerus <[email protected]>
Re: [PATCH v3 2/2] software node: Initialize the return value in software_node_find_by_name()
Quoted 6 lines · Greg Kroah-Hartman
Quoted 4 lines · Heikki Krogerus
The software node is searched from a list that may be empty when the function is called. This makes sure that the function returns NULL if the list is empty.
Quoted 6 lines
Quoted 4 lines
Fixes 1666faedb567 ("software node: Add software_node_get_reference_args()")Reported-by kbuild test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Heikki Krogerus <[email protected]>Reviewed-by Greg Kroah-Hartman <[email protected]>
Applied, thanks!