[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130701200732.480333896@linuxfoundation.org>
Date: Mon, 1 Jul 2013 13:10:18 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Tang Yuantian <Yuantian.Tang@...escale.com>,
Grant Likely <grant.likely@...aro.org>,
Guenter Roeck <linux@...ck-us.net>
Subject: [ 23/26] of/base: release the node correctly in of_parse_phandle_with_args()
3.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tang Yuantian <yuantian.tang@...escale.com>
commit b855f16b05a697ac1863adabe99bfba56e6d3199 upstream.
Call of_node_put() only when the out_args is NULL on success,
or the node's reference count will not be correct because the caller
will call of_node_put() again.
Signed-off-by: Tang Yuantian <Yuantian.Tang@...escale.com>
[grant.likely: tightened up the patch]
Signed-off-by: Grant Likely <grant.likely@...aro.org>
Cc: Guenter Roeck <linux@...ck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/of/base.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1166,11 +1166,11 @@ static int __of_parse_phandle_with_args(
out_args->args_count = count;
for (i = 0; i < count; i++)
out_args->args[i] = be32_to_cpup(list++);
+ } else {
+ of_node_put(node);
}
/* Found it! return success */
- if (node)
- of_node_put(node);
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists