aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/mesh.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/mesh.c')
-rw-r--r--drivers/net/wireless/libertas/mesh.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c
index acf3bf63ee33..9d097b9c8005 100644
--- a/drivers/net/wireless/libertas/mesh.c
+++ b/drivers/net/wireless/libertas/mesh.c
@@ -918,7 +918,6 @@ static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,
918 char *buf) 918 char *buf)
919{ 919{
920 struct mrvl_mesh_defaults defs; 920 struct mrvl_mesh_defaults defs;
921 int maxlen;
922 int ret; 921 int ret;
923 922
924 ret = mesh_get_default_parameters(dev, &defs); 923 ret = mesh_get_default_parameters(dev, &defs);
@@ -931,13 +930,11 @@ static ssize_t mesh_id_get(struct device *dev, struct device_attribute *attr,
931 defs.meshie.val.mesh_id_len = IEEE80211_MAX_SSID_LEN; 930 defs.meshie.val.mesh_id_len = IEEE80211_MAX_SSID_LEN;
932 } 931 }
933 932
934 /* SSID not null terminated: reserve room for \0 + \n */ 933 memcpy(buf, defs.meshie.val.mesh_id, defs.meshie.val.mesh_id_len);
935 maxlen = defs.meshie.val.mesh_id_len + 2; 934 buf[defs.meshie.val.mesh_id_len] = '\n';
936 maxlen = (PAGE_SIZE > maxlen) ? maxlen : PAGE_SIZE; 935 buf[defs.meshie.val.mesh_id_len + 1] = '\0';
937 936
938 defs.meshie.val.mesh_id[defs.meshie.val.mesh_id_len] = '\0'; 937 return defs.meshie.val.mesh_id_len + 1;
939
940 return snprintf(buf, maxlen, "%s\n", defs.meshie.val.mesh_id);
941} 938}
942 939
943/** 940/**