linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [mmotm:master 200/417] mm/slab_common.c:166 update_memcg_params() warn: variable dereferenced before check 'old' (see line 162)
@ 2015-01-26  8:56 Dan Carpenter
  2015-01-26 10:01 ` [PATCH -mm] slab: update_memcg_params: explicitly check that old array != NULL Vladimir Davydov
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2015-01-26  8:56 UTC (permalink / raw)
  To: kbuild, Vladimir Davydov
  Cc: Johannes Weiner, Andrew Morton, Linux Memory Management List,
	Dan Carpenter

tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   c64429bcc60a702f19f5cfdb5c39277863278a8c
commit: 5d06629c100b942a51f02b4d886c116ba3afb32a [200/417] slab: embed memcg_cache_params to kmem_cache

mm/slab_common.c:166 update_memcg_params() warn: variable dereferenced before check 'old' (see line 162)

git remote add mmotm git://git.cmpxchg.org/linux-mmotm.git
git remote update mmotm
git checkout 5d06629c100b942a51f02b4d886c116ba3afb32a
vim +/old +166 mm/slab_common.c

5d06629c Vladimir Davydov 2015-01-24  156  					lockdep_is_held(&slab_mutex));
5d06629c Vladimir Davydov 2015-01-24  157  	new = kzalloc(sizeof(struct memcg_cache_array) +
5d06629c Vladimir Davydov 2015-01-24  158  		      new_array_size * sizeof(void *), GFP_KERNEL);
5d06629c Vladimir Davydov 2015-01-24  159  	if (!new)
6f817f4c Vladimir Davydov 2014-10-09  160  		return -ENOMEM;
6f817f4c Vladimir Davydov 2014-10-09  161  
5d06629c Vladimir Davydov 2015-01-24 @162  	memcpy(new->entries, old->entries,
88a0b848 Vladimir Davydov 2015-01-24  163  	       memcg_nr_cache_ids * sizeof(void *));
6f817f4c Vladimir Davydov 2014-10-09  164  
5d06629c Vladimir Davydov 2015-01-24  165  	rcu_assign_pointer(s->memcg_params.memcg_caches, new);
5d06629c Vladimir Davydov 2015-01-24 @166  	if (old)
5d06629c Vladimir Davydov 2015-01-24  167  		kfree_rcu(old, rcu);
6f817f4c Vladimir Davydov 2014-10-09  168  	return 0;
6f817f4c Vladimir Davydov 2014-10-09  169  }

---
0-DAY kernel test infrastructure                Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-26 15:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-26  8:56 [mmotm:master 200/417] mm/slab_common.c:166 update_memcg_params() warn: variable dereferenced before check 'old' (see line 162) Dan Carpenter
2015-01-26 10:01 ` [PATCH -mm] slab: update_memcg_params: explicitly check that old array != NULL Vladimir Davydov
2015-01-26 10:23   ` Dan Carpenter
2015-01-26 10:45     ` Vladimir Davydov
2015-01-26 15:13       ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).