On Thu, Nov 17, 2022 at 11:44:23AM +0800, Gaosheng Cui wrote: > Smatch report warning as follows: > > drivers/hwmon/ibmpex.c:509 ibmpex_register_bmc() warn: > '&data->list' not removed from list > > If ibmpex_find_sensors() fails in ibmpex_register_bmc(), data will > be freed, but data->list will not be removed from driver_data.bmc_data, > then list traversal may cause UAF. > > Fix by removeing it from driver_data.bmc_data before free(). > > Fixes: 57c7c3a0fdea ("hwmon: IBM power meter driver") > Signed-off-by: Gaosheng Cui <cuigaosheng1@xxxxxxxxxx> Applied. Thanks, Guenter