Commit 8ad59b3
i2c: piix4: Fix a memory leak in the EFCH MMIO support
The recently added support for EFCH MMIO regions introduced a memory
leak in that code path. The leak is caused by the fact that
release_resource() merely removes the resource from the tree but does
not free its memory. We need to call release_mem_region() instead,
which does free the memory. As a nice side effect, this brings back
some symmetry between the legacy and MMIO paths.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Reviewed-by: Terry Bowman <terry.bowman@amd.com>
Tested-by: Terry Bowman <Terry.Bowman@amd.com>
Fixes: 7c14872 ("i2c: piix4: Add EFCH MMIO support to region request and release")
Signed-off-by: Wolfram Sang <wsa@kernel.org>1 parent 03c765b commit 8ad59b3
1 file changed
Lines changed: 7 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | 164 | | |
166 | 165 | | |
167 | 166 | | |
| |||
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
182 | | - | |
183 | 181 | | |
184 | 182 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
189 | 186 | | |
190 | 187 | | |
191 | 188 | | |
| |||
195 | 192 | | |
196 | 193 | | |
197 | 194 | | |
198 | | - | |
| 195 | + | |
| 196 | + | |
199 | 197 | | |
200 | 198 | | |
201 | 199 | | |
202 | 200 | | |
203 | | - | |
204 | 201 | | |
205 | 202 | | |
206 | 203 | | |
| |||
222 | 219 | | |
223 | 220 | | |
224 | 221 | | |
225 | | - | |
| 222 | + | |
| 223 | + | |
226 | 224 | | |
227 | 225 | | |
228 | 226 | | |
| |||
0 commit comments