[PATCH v3 11/20] remoteproc: core: Correction carveout name comparison in rproc_update_resource_table_entry

2016-10-12 Thread Loic Pallardy
As old and new carveout name length may be different and the two
names may have a common part, name comparison must cover the complete
name field.
Limit strncmp to carveout name length, i.e. 32 Bytes.

Signed-off-by: Loic Pallardy 
---
 drivers/remoteproc/remoteproc_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c 
b/drivers/remoteproc/remoteproc_core.c
index 4a61dc1..96692c2 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -956,8 +956,7 @@ static int rproc_update_resource_table_entry(struct rproc 
*rproc,
tblc = rsc;
newc = request->resource;
 
-   if (strncmp(newc->name, tblc->name,
-   sizeof(*tblc->name)))
+   if (strncmp(newc->name, tblc->name, 32))
break;
 
memcpy(tblc, newc, request->size);
-- 
1.9.1



[PATCH v3 11/20] remoteproc: core: Correction carveout name comparison in rproc_update_resource_table_entry

2016-10-12 Thread Loic Pallardy
As old and new carveout name length may be different and the two
names may have a common part, name comparison must cover the complete
name field.
Limit strncmp to carveout name length, i.e. 32 Bytes.

Signed-off-by: Loic Pallardy 
---
 drivers/remoteproc/remoteproc_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c 
b/drivers/remoteproc/remoteproc_core.c
index 4a61dc1..96692c2 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -956,8 +956,7 @@ static int rproc_update_resource_table_entry(struct rproc 
*rproc,
tblc = rsc;
newc = request->resource;
 
-   if (strncmp(newc->name, tblc->name,
-   sizeof(*tblc->name)))
+   if (strncmp(newc->name, tblc->name, 32))
break;
 
memcpy(tblc, newc, request->size);
-- 
1.9.1