Commit b64700d
squashfs: fix memory leak in squashfs_fill_super
If sb_min_blocksize returns 0, squashfs_fill_super exits without freeing
allocated memory (sb->s_fs_info).
Fix this by moving the call to sb_min_blocksize to before memory is
allocated.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 734aa85 ("Squashfs: check return result of sb_min_blocksize")
Signed-off-by: Phillip Lougher <[email protected]>
Reported-by: Scott GUO <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent 44958f2 commit b64700d
1 file changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
194 | 199 | | |
195 | 200 | | |
196 | 201 | | |
| |||
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
0 commit comments