In the Linux kernel, the following vulnerability has been resolved:
iio: gts-helper: Fix memory leaks for the error path of iiogtsbuildavailscale_table()
If pertimescales[i] or pertimegains[i] kcalloc fails in the for loop of iiogtsbuildavailscaletable(), the errfreeout will fail to call kfree() each time when i is reduced to 0, so all the pertimescales[0] and pertime_gains[0] will not be freed, which will cause memory leaks.
Fix it by checking if i >= 0.