Commit b5e5797
idpf: only assign num refillqs if allocation was successful
As reported by AI review [1], if the refillqs allocation fails, refillqs
will be NULL but num_refillqs will be non-zero. The release function
will then dereference refillqs since it thinks the refillqs are present,
resulting in a NULL ptr dereference.
Only assign the num refillqs if the allocation was successful. This will
prevent the release function from entering the loop and accessing
refillqs.
[1] https://lore.kernel.org/netdev/[email protected]/
Fixes: 95af467 ("idpf: configure resources for RX queues")
Signed-off-by: Joshua Hay <[email protected]>
Reviewed-by: Madhu Chittim <[email protected]>
Reviewed-by: Aleksandr Loktionov <[email protected]>
Tested-by: Samuel Salin <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>1 parent 1eb0db7 commit b5e5797
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1860 | 1860 | | |
1861 | 1861 | | |
1862 | 1862 | | |
1863 | | - | |
1864 | 1863 | | |
1865 | 1864 | | |
1866 | 1865 | | |
1867 | 1866 | | |
1868 | 1867 | | |
1869 | 1868 | | |
| 1869 | + | |
1870 | 1870 | | |
1871 | 1871 | | |
1872 | 1872 | | |
| |||
0 commit comments