Linux cgroups development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: re: cgroup: convert to kernfs
Date: Wed, 12 Feb 2014 22:27:53 +0300	[thread overview]
Message-ID: <20140212192753.GA5217@elgon.mountain> (raw)

Hello Tejun Heo,

The patch 2bd59d48ebfb: "cgroup: convert to kernfs" from Feb 11,
2014, leads to the following static checker warning:

	kernel/cgroup.c:2442 cgroup_add_cftypes()
	warn: possible memory leak of 'set'

kernel/cgroup.c
  2431  int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
  2432  {
  2433          struct cftype_set *set;
  2434          int ret;
  2435  
  2436          set = kzalloc(sizeof(*set), GFP_KERNEL);
  2437          if (!set)
  2438                  return -ENOMEM;
  2439  
  2440          ret = cgroup_init_cftypes(ss, cfts);
  2441          if (ret)

kfree(set);

  2442                  return ret;
  2443  
  2444          cgroup_cfts_prepare();
  2445          set->cfts = cfts;
  2446          list_add_tail(&set->node, &ss->cftsets);
  2447          ret = cgroup_cfts_commit(cfts, true);
  2448          if (ret)
  2449                  cgroup_rm_cftypes(cfts);
  2450          return ret;
  2451  }

regards,
dan carpenter

             reply	other threads:[~2014-02-12 19:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 19:27 Dan Carpenter [this message]
     [not found] ` <20140212192753.GA5217-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2014-02-12 19:53   ` cgroup: convert to kernfs Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140212192753.GA5217@elgon.mountain \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox