Patch "thermal: core: Adding missing nlmsg_free() in thermal_genl_sampling_temp()" has been added to the 5.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

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

to the 5.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     thermal-core-adding-missing-nlmsg_free-in-thermal_ge.patch
and it can be found in the queue-5.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 322a024974f4ae5265d42af103daae9c3372cda7
Author: Jing Xiangfeng <jingxiangfeng@xxxxxxxxxx>
Date:   Tue Sep 29 16:26:52 2020 +0800

    thermal: core: Adding missing nlmsg_free() in thermal_genl_sampling_temp()
    
    [ Upstream commit 48b458591749d35c927351b4960b49e35af30fe6 ]
    
    thermal_genl_sampling_temp() misses to call nlmsg_free() in an error path.
    
    Jump to out_free to fix it.
    
    Fixes: 1ce50e7d408ef2 ("thermal: core: genetlink support for events/cmd/sampling")
    Signed-off-by: Jing Xiangfeng <jingxiangfeng@xxxxxxxxxx>
    Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200929082652.59876-1-jingxiangfeng@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/thermal/thermal_netlink.c b/drivers/thermal/thermal_netlink.c
index af7b2383e8f6b..019f4812def6c 100644
--- a/drivers/thermal/thermal_netlink.c
+++ b/drivers/thermal/thermal_netlink.c
@@ -78,7 +78,7 @@ int thermal_genl_sampling_temp(int id, int temp)
 	hdr = genlmsg_put(skb, 0, 0, &thermal_gnl_family, 0,
 			  THERMAL_GENL_SAMPLING_TEMP);
 	if (!hdr)
-		return -EMSGSIZE;
+		goto out_free;
 
 	if (nla_put_u32(skb, THERMAL_GENL_ATTR_TZ_ID, id))
 		goto out_cancel;
@@ -93,6 +93,7 @@ int thermal_genl_sampling_temp(int id, int temp)
 	return 0;
 out_cancel:
 	genlmsg_cancel(skb, hdr);
+out_free:
 	nlmsg_free(skb);
 
 	return -EMSGSIZE;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux