diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-03 03:11:30 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-03 03:11:30 +0200 |
commit | 338e6dc8a5e3d9c5eccc317e0476d43e6e4182c2 (patch) | |
tree | a6919292fe7244ff2b33e7503fdce49108421de4 /device.c | |
parent | 9bebe7d7bc94667c793d1956e2960163dee75e51 (diff) |
fix device reload with no previous config
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -305,8 +305,11 @@ device_reload_config(struct device *dev, struct blob_attr *attr) blobmsg_parse(dev_attrs, __DEV_ATTR_MAX, tb, blob_data(attr), blob_len(attr)); - blobmsg_parse(dev_attrs, __DEV_ATTR_MAX, tb1, - blob_data(dev->config), blob_len(dev->config)); + if (dev->config) + blobmsg_parse(dev_attrs, __DEV_ATTR_MAX, tb1, + blob_data(dev->config), blob_len(dev->config)); + else + memset(tb1, 0, sizeof(tb1)); if (!config_diff(tb, tb1, &device_attr_list, NULL)) return DEV_CONFIG_NO_CHANGE; |