ledtrig-netdev: reset link status & stats after changing device_name

Previously switching to non-existing device (interface) could result in
leaving LED on.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 47990
owl
Rafał Miłecki 2015-12-23 17:11:49 +00:00
parent 2b1129a7ba
commit e9e3a0682c
1 changed files with 2 additions and 0 deletions

View File

@ -122,6 +122,8 @@ static ssize_t led_device_name_store(struct device *dev,
strcpy(trigger_data->device_name, buf);
if (size > 0 && trigger_data->device_name[size-1] == '\n')
trigger_data->device_name[size-1] = 0;
trigger_data->link_up = 0;
trigger_data->last_activity = 0;
if (trigger_data->device_name[0] != 0) {
/* check for existing device to update from */