diff options
Diffstat (limited to 'drivers/edac/edac_mc_sysfs.c')
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 479492819dba..ad218fe4942d 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -178,7 +178,11 @@ static ssize_t csrow_edac_mode_show(struct csrow_info *csrow, char *data, | |||
178 | static ssize_t channel_dimm_label_show(struct csrow_info *csrow, | 178 | static ssize_t channel_dimm_label_show(struct csrow_info *csrow, |
179 | char *data, int channel) | 179 | char *data, int channel) |
180 | { | 180 | { |
181 | return snprintf(data, EDAC_MC_LABEL_LEN, "%s", | 181 | /* if field has not been initialized, there is nothing to send */ |
182 | if (!csrow->channels[channel].label[0]) | ||
183 | return 0; | ||
184 | |||
185 | return snprintf(data, EDAC_MC_LABEL_LEN, "%s\n", | ||
182 | csrow->channels[channel].label); | 186 | csrow->channels[channel].label); |
183 | } | 187 | } |
184 | 188 | ||