Commit 98657ab
committed
idpf: fix potential memory leak on kcalloc() failure
JIRA: https://issues.redhat.com/browse/RHEL-79686
commit 8a558cb
Author: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Date: Fri Apr 4 12:54:21 2025 +0200
idpf: fix potential memory leak on kcalloc() failure
In case of failing on rss_data->rss_key allocation the function is
freeing vport without freeing earlier allocated q_vector_idxs. Fix it.
Move from freeing in error branch to goto scheme.
Fixes: d4d5587 ("idpf: initialize interrupts and enable vport")
Reviewed-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Suggested-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>1 parent d818ae2 commit 98657ab
1 file changed
+11
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1112 | 1112 | | |
1113 | 1113 | | |
1114 | 1114 | | |
1115 | | - | |
1116 | | - | |
| 1115 | + | |
| 1116 | + | |
1117 | 1117 | | |
1118 | | - | |
1119 | | - | |
1120 | 1118 | | |
1121 | 1119 | | |
1122 | 1120 | | |
| |||
1126 | 1124 | | |
1127 | 1125 | | |
1128 | 1126 | | |
1129 | | - | |
1130 | | - | |
| 1127 | + | |
| 1128 | + | |
1131 | 1129 | | |
1132 | | - | |
1133 | | - | |
1134 | 1130 | | |
1135 | 1131 | | |
1136 | 1132 | | |
| |||
1143 | 1139 | | |
1144 | 1140 | | |
1145 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1146 | 1149 | | |
1147 | 1150 | | |
1148 | 1151 | | |
| |||
0 commit comments