Skip to content

Commit 48b4585

Browse files
hiss2018dlezcano
authored andcommitted
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: 1ce50e7 ("thermal: core: genetlink support for events/cmd/sampling") Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200929082652.59876-1-jingxiangfeng@huawei.com
1 parent 5093402 commit 48b4585

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/thermal/thermal_netlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int thermal_genl_sampling_temp(int id, int temp)
7878
hdr = genlmsg_put(skb, 0, 0, &thermal_gnl_family, 0,
7979
THERMAL_GENL_SAMPLING_TEMP);
8080
if (!hdr)
81-
return -EMSGSIZE;
81+
goto out_free;
8282

8383
if (nla_put_u32(skb, THERMAL_GENL_ATTR_TZ_ID, id))
8484
goto out_cancel;
@@ -93,6 +93,7 @@ int thermal_genl_sampling_temp(int id, int temp)
9393
return 0;
9494
out_cancel:
9595
genlmsg_cancel(skb, hdr);
96+
out_free:
9697
nlmsg_free(skb);
9798

9899
return -EMSGSIZE;

0 commit comments

Comments
 (0)