cgroup: typo fix

Submitted by Andrei Vagin on June 16, 2016, 4:37 a.m.

Details

Message ID 1466051842-16217-1-git-send-email-avagin@openvz.org
State Accepted
Series "cgroup: typo fix"
Commit 41fe3379697a14497f3b5e636f62ab8999491153
Headers show

Commit Message

Andrei Vagin June 16, 2016, 4:37 a.m.
From: Andrew Vagin <avagin@virtuozzo.com>

CID 163487 (#1 of 1): Unused value (UNUSED_VALUE)
assigned_pointer: Assigning value from old_name to pe->name here, but that stored value is overwritten before it can be used.

Cc: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
---
 criu/cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/cgroup.c b/criu/cgroup.c
index 45a06ca..b60b8ee 100644
--- a/criu/cgroup.c
+++ b/criu/cgroup.c
@@ -1282,7 +1282,7 @@  static int prepare_cgroup_dir_properties(char *path, int off, CgroupDirEntry **e
 					pe->value = "a";
 					ret = restore_cgroup_prop(e->properties[j], path, off2);
 					pe->name = old_name;
-					pe->name = old_val;
+					pe->value = old_val;
 
 					if (ret < 0)
 						return -1;

Comments

Tycho Andersen June 16, 2016, 2:41 p.m.
On Thu, Jun 16, 2016 at 07:37:22AM +0300, Andrey Vagin wrote:
> From: Andrew Vagin <avagin@virtuozzo.com>
> 
> CID 163487 (#1 of 1): Unused value (UNUSED_VALUE)
> assigned_pointer: Assigning value from old_name to pe->name here, but that stored value is overwritten before it can be used.
> 
> Cc: Tycho Andersen <tycho.andersen@canonical.com>

Hmm, I wonder why the test doesn't catch this. Anyway, thanks,

Acked-by: Tycho Andersen <tycho.andersen@canonical.com>

> Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
> ---
>  criu/cgroup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/cgroup.c b/criu/cgroup.c
> index 45a06ca..b60b8ee 100644
> --- a/criu/cgroup.c
> +++ b/criu/cgroup.c
> @@ -1282,7 +1282,7 @@ static int prepare_cgroup_dir_properties(char *path, int off, CgroupDirEntry **e
>  					pe->value = "a";
>  					ret = restore_cgroup_prop(e->properties[j], path, off2);
>  					pe->name = old_name;
> -					pe->name = old_val;
> +					pe->value = old_val;
>  
>  					if (ret < 0)
>  						return -1;
> -- 
> 2.7.4
>
Pavel Emelianov June 17, 2016, 1:52 p.m.
Applied