Commit 3e34c6dc authored by Ivo van Doorn's avatar Ivo van Doorn Committed by David S. Miller
Browse files

rt2x00: Fix chipset debugfs file



Initialize blob->data before moving the data pointer
Initialize blob->size based on blob->data size

This fixes the empty chipset file in debugfs.
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 96c755a3
......@@ -417,6 +417,7 @@ static struct dentry *rt2x00debug_create_file_chipset(const char *name,
if (!data)
return NULL;
blob->data = data;
data += sprintf(data, "rt chip: %04x\n", intf->rt2x00dev->chip.rt);
data += sprintf(data, "rf chip: %04x\n", intf->rt2x00dev->chip.rf);
data += sprintf(data, "revision:%08x\n", intf->rt2x00dev->chip.rev);
......@@ -425,9 +426,7 @@ static struct dentry *rt2x00debug_create_file_chipset(const char *name,
data += sprintf(data, "eeprom length: %d\n", debug->eeprom.word_count);
data += sprintf(data, "bbp length: %d\n", debug->bbp.word_count);
data += sprintf(data, "rf length: %d\n", debug->rf.word_count);
blob->data = data;
blob->size = strlen(data);
blob->size = strlen(blob->data);
return debugfs_create_blob(name, S_IRUGO, intf->driver_folder, blob);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment