]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
thermal: shorten too long mcast group name
authorMasatake YAMATO <yamato@redhat.com>
Mon, 1 Apr 2013 18:50:40 +0000 (14:50 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 17:16:53 +0000 (10:16 -0700)
[ Upstream commits 73214f5d9f33b79918b1f7babddd5c8af28dd23d
  and f1e79e208076ffe7bad97158275f1c572c04f5c7, the latter
  adds an assertion to genetlink to prevent this from happening
  again in the future. ]

The original name is too long.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/thermal.h
net/netlink/genetlink.c

index d3ec89fb4122610c26dfe0d86f499d50539280ff..6b762c63e6c14b9485623aaf77ba6a3d3d532124 100644 (file)
@@ -130,7 +130,7 @@ struct thermal_zone_device {
 /* Adding event notification support elements */
 #define THERMAL_GENL_FAMILY_NAME                "thermal_event"
 #define THERMAL_GENL_VERSION                    0x01
-#define THERMAL_GENL_MCAST_GROUP_NAME           "thermal_mc_group"
+#define THERMAL_GENL_MCAST_GROUP_NAME           "thermal_mc_grp"
 
 enum events {
        THERMAL_AUX0,
index 482fa571b4eecb9b89bc67ac523f0ff6c08ef0f5..874f8ffbe423607171ba88cfa2cb73edd689c708 100644 (file)
@@ -134,6 +134,7 @@ int genl_register_mc_group(struct genl_family *family,
        int err = 0;
 
        BUG_ON(grp->name[0] == '\0');
+       BUG_ON(memchr(grp->name, '\0', GENL_NAMSIZ) == NULL);
 
        genl_lock();