Commit 2a8a5a5
scsi: elx: efct: Fix memory leak in efct_hw_parse_filter()
strsep() modifies the address of the pointer passed to it so that it no
longer points to the original address. This means kfree() gets the wrong
pointer.
Fix this by passing unmodified pointer returned from kstrdup() to
kfree().
Found by Linux Verification Center (linuxtesting.org) with Svace.
Fixes: 4df84e8 ("scsi: elx: efct: Driver initialization routines")
Signed-off-by: Vitaliy Shevtsov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Daniel Wagner <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent d8ab68b commit 2a8a5a5
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1120 | 1120 | | |
1121 | 1121 | | |
1122 | 1122 | | |
1123 | | - | |
| 1123 | + | |
1124 | 1124 | | |
1125 | 1125 | | |
1126 | 1126 | | |
| |||
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
| 1135 | + | |
1135 | 1136 | | |
1136 | 1137 | | |
1137 | 1138 | | |
| |||
1144 | 1145 | | |
1145 | 1146 | | |
1146 | 1147 | | |
1147 | | - | |
| 1148 | + | |
1148 | 1149 | | |
1149 | 1150 | | |
1150 | 1151 | | |
| |||
0 commit comments