Commit 48b45859 authored by Jing Xiangfeng's avatar Jing Xiangfeng Committed by Daniel Lezcano

thermal: core: Adding missing nlmsg_free() in thermal_genl_sampling_temp()

thermal_genl_sampling_temp() misses to call nlmsg_free() in an error path.

Jump to out_free to fix it.

Fixes: 1ce50e7d ("thermal: core: genetlink support for events/cmd/sampling")
Signed-off-by: default avatarJing Xiangfeng <jingxiangfeng@huawei.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200929082652.59876-1-jingxiangfeng@huawei.com
parent 5093402e
...@@ -78,7 +78,7 @@ int thermal_genl_sampling_temp(int id, int temp) ...@@ -78,7 +78,7 @@ int thermal_genl_sampling_temp(int id, int temp)
hdr = genlmsg_put(skb, 0, 0, &thermal_gnl_family, 0, hdr = genlmsg_put(skb, 0, 0, &thermal_gnl_family, 0,
THERMAL_GENL_SAMPLING_TEMP); THERMAL_GENL_SAMPLING_TEMP);
if (!hdr) if (!hdr)
return -EMSGSIZE; goto out_free;
if (nla_put_u32(skb, THERMAL_GENL_ATTR_TZ_ID, id)) if (nla_put_u32(skb, THERMAL_GENL_ATTR_TZ_ID, id))
goto out_cancel; goto out_cancel;
...@@ -93,6 +93,7 @@ int thermal_genl_sampling_temp(int id, int temp) ...@@ -93,6 +93,7 @@ int thermal_genl_sampling_temp(int id, int temp)
return 0; return 0;
out_cancel: out_cancel:
genlmsg_cancel(skb, hdr); genlmsg_cancel(skb, hdr);
out_free:
nlmsg_free(skb); nlmsg_free(skb);
return -EMSGSIZE; return -EMSGSIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment