2010-02-24 13:36:28

by Kirill A. Shutemov

[permalink] [raw]
Subject: [PATCH -mmotm] cgroup: fix typo in error handling in cgroup_write_event_control()

Actually, we want to fput() cfile, if cfile is not NULL.

Signed-off-by: Kirill A. Shutemov <[email protected]>
---
kernel/cgroup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index d142524..049ce0d 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -3117,7 +3117,7 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
return 0;

fail:
- if (!cfile)
+ if (cfile)
fput(cfile);

if (event && event->eventfd && !IS_ERR(event->eventfd))
--
1.6.6.2


2010-02-24 16:04:16

by Paul Menage

[permalink] [raw]
Subject: Re: [PATCH -mmotm] cgroup: fix typo in error handling in cgroup_write_event_control()

On Wed, Feb 24, 2010 at 5:31 AM, Kirill A. Shutemov
<[email protected]> wrote:
> Actually, we want to fput() cfile, if cfile is not NULL.
>
> Signed-off-by: Kirill A. Shutemov <[email protected]>

Thanks.

Acked-by: Paul Menage <[email protected]>

> ---
> ?kernel/cgroup.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index d142524..049ce0d 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -3117,7 +3117,7 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
> ? ? ? ?return 0;
>
> ?fail:
> - ? ? ? if (!cfile)
> + ? ? ? if (cfile)
> ? ? ? ? ? ? ? ?fput(cfile);
>
> ? ? ? ?if (event && event->eventfd && !IS_ERR(event->eventfd))
> --
> 1.6.6.2
>
>