linux/fs/ceph
Julia Lawall 60d877334f fs/ceph: introduce missing kfree
Error handling code following a kmalloc should free the allocated data.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@

x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...x...+> }
(
x->f1 = E
|
 (x->f1 == NULL || ...)
|
 f(...,x->f1,...)
)
...>
(
 return \(0\|<+...x...+>\|ptr\);
|
 return@p2 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-21 13:05:14 -08:00
..
crush ceph: make CRUSH hash function a bucket property 2009-11-07 20:18:22 -08:00
addr.c ceph: allocate and parse mount args before client instance 2009-10-27 11:57:03 -07:00
auth_none.c ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
auth_none.h ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
auth.c ceph: mount fails immediately on error 2009-11-20 14:24:46 -08:00
auth.h ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
buffer.c ceph: ref counted buffer 2009-10-06 11:31:07 -07:00
buffer.h ceph: ref counted buffer 2009-10-06 11:31:07 -07:00
caps.c ceph: fix page invalidation deadlock 2009-11-12 15:57:05 -08:00
ceph_debug.h ceph: client types 2009-10-06 11:31:07 -07:00
ceph_frag.c ceph: client types 2009-10-06 11:31:07 -07:00
ceph_frag.h ceph: client types 2009-10-06 11:31:07 -07:00
ceph_fs.c ceph: make object hash a pg_pool property 2009-11-06 21:55:25 -08:00
ceph_fs.h ceph: decode updated mdsmap format 2009-11-20 14:24:33 -08:00
ceph_hash.c ceph: small cleanup in hash function 2009-11-20 14:24:26 -08:00
ceph_hash.h ceph: make object hash a pg_pool property 2009-11-06 21:55:25 -08:00
ceph_strings.c ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
debugfs.c ceph: fix debugfs entry, simplify fsid checks 2009-11-20 14:24:27 -08:00
decode.h ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
dir.c ceph: exclude snapdir from readdir results 2009-11-11 15:50:25 -08:00
export.c ceph: nfs re-export support 2009-10-06 11:31:13 -07:00
file.c ceph: fix sparse endian warning 2009-11-04 16:36:12 -08:00
inode.c ceph: initialize i_size/i_rbytes on snapdir 2009-11-11 15:50:28 -08:00
ioctl.c ceph: fix endian conversions for ceph_pg 2009-11-04 16:36:07 -08:00
ioctl.h ceph: ioctls 2009-10-06 11:31:14 -07:00
Kconfig ceph: Kconfig, Makefile 2009-10-06 11:31:15 -07:00
Makefile ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
mds_client.c ceph: reset requested max_size after mds reconnect 2009-11-20 14:24:52 -08:00
mds_client.h ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
mdsmap.c ceph: decode updated mdsmap format 2009-11-20 14:24:33 -08:00
mdsmap.h ceph: decode updated mdsmap format 2009-11-20 14:24:33 -08:00
messenger.c ceph: reset msgr backoff during open, not after successful handshake 2009-11-20 15:14:15 -08:00
messenger.h ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
mon_client.c ceph: remove dead code 2009-11-20 15:17:24 -08:00
mon_client.h ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
msgpool.c ceph: warn on allocation from msgpool with larger front_len 2009-10-15 18:14:43 -07:00
msgpool.h ceph: warn on allocation from msgpool with larger front_len 2009-10-15 18:14:43 -07:00
msgr.h ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
osd_client.c ceph: fix debugfs entry, simplify fsid checks 2009-11-20 14:24:27 -08:00
osd_client.h ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
osdmap.c ceph: make CRUSH hash function a bucket property 2009-11-07 20:18:22 -08:00
osdmap.h ceph: fix endian conversions for ceph_pg 2009-11-04 16:36:07 -08:00
rados.h ceph: negotiate authentication protocol; implement AUTH_NONE protocol 2009-11-18 16:19:57 -08:00
README ceph: make object hash a pg_pool property 2009-11-06 21:55:25 -08:00
snap.c ceph: snapshot management 2009-10-06 11:31:12 -07:00
super.c ceph: mount fails immediately on error 2009-11-20 14:24:46 -08:00
super.h ceph: fix debugfs entry, simplify fsid checks 2009-11-20 14:24:27 -08:00
types.h ceph: make object hash a pg_pool property 2009-11-06 21:55:25 -08:00
xattr.c fs/ceph: introduce missing kfree 2009-11-21 13:05:14 -08:00

#
# The following files are shared by (and manually synchronized
# between) the Ceph userland and kernel client.
#
# userland                  kernel
src/include/ceph_fs.h	    fs/ceph/ceph_fs.h
src/include/ceph_fs.cc	    fs/ceph/ceph_fs.c
src/include/msgr.h	    fs/ceph/msgr.h
src/include/rados.h	    fs/ceph/rados.h
src/include/ceph_strings.cc fs/ceph/ceph_strings.c
src/include/ceph_frag.h	    fs/ceph/ceph_frag.h
src/include/ceph_frag.cc    fs/ceph/ceph_frag.c
src/include/ceph_hash.h	    fs/ceph/ceph_hash.h
src/include/ceph_hash.cc    fs/ceph/ceph_hash.c
src/crush/crush.c	    fs/ceph/crush/crush.c
src/crush/crush.h	    fs/ceph/crush/crush.h
src/crush/mapper.c	    fs/ceph/crush/mapper.c
src/crush/mapper.h	    fs/ceph/crush/mapper.h
src/crush/hash.h	    fs/ceph/crush/hash.h
src/crush/hash.c	    fs/ceph/crush/hash.c