Repository navigation
Commit 7d5079a
rbd: use rbd_segment_name_free() instead of kfree()
Free memory allocated using kmem_cache_zalloc using kmem_cache_free
rather than kfree. The helper rbd_segment_name_free does the job here.
Its position is shifted above the calling function.
The Coccinelle semantic patch that detects this change is as follows:
// <smpl>
@@
expression x,E,c;
@@
x = \(kmem_cache_alloc\|kmem_cache_zalloc\|kmem_cache_alloc_node\)(c,...)
... when != x = E
when != &x
?-kfree(x)
+kmem_cache_free(c,x)
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>1 parent d0d0db2 commit 7d5079a
1 file changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1139 | 1139 | | |
1140 | 1140 | | |
1141 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1142 | 1149 | | |
1143 | 1150 | | |
1144 | 1151 | | |
| |||
1158 | 1165 | | |
1159 | 1166 | | |
1160 | 1167 | | |
1161 | | - | |
| 1168 | + | |
1162 | 1169 | | |
1163 | 1170 | | |
1164 | 1171 | | |
1165 | 1172 | | |
1166 | 1173 | | |
1167 | 1174 | | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | 1175 | | |
1176 | 1176 | | |
1177 | 1177 | | |
| |||
0 commit comments