diff options
Diffstat (limited to 'drivers/watchdog/ziirave_wdt.c')
| -rw-r--r-- | drivers/watchdog/ziirave_wdt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/watchdog/ziirave_wdt.c b/drivers/watchdog/ziirave_wdt.c index c5a9b820d43a..5c6e3fa001d8 100644 --- a/drivers/watchdog/ziirave_wdt.c +++ b/drivers/watchdog/ziirave_wdt.c @@ -20,7 +20,7 @@ #include <linux/types.h> #include <linux/watchdog.h> -#include <asm/unaligned.h> +#include <linux/unaligned.h> #define ZIIRAVE_TIMEOUT_MIN 3 #define ZIIRAVE_TIMEOUT_MAX 255 @@ -302,6 +302,9 @@ static int ziirave_firm_verify(struct watchdog_device *wdd, const u16 len = be16_to_cpu(rec->len); const u32 addr = be32_to_cpu(rec->addr); + if (len > sizeof(data)) + return -EINVAL; + if (ziirave_firm_addr_readonly(addr)) continue; @@ -593,8 +596,7 @@ static int ziirave_wdt_init_duration(struct i2c_client *client) reset_duration); } -static int ziirave_wdt_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int ziirave_wdt_probe(struct i2c_client *client) { int ret; struct ziirave_wdt_data *w_priv; @@ -708,17 +710,15 @@ static int ziirave_wdt_probe(struct i2c_client *client, return ret; } -static int ziirave_wdt_remove(struct i2c_client *client) +static void ziirave_wdt_remove(struct i2c_client *client) { struct ziirave_wdt_data *w_priv = i2c_get_clientdata(client); watchdog_unregister_device(&w_priv->wdd); - - return 0; } static const struct i2c_device_id ziirave_wdt_id[] = { - { "rave-wdt", 0 }, + { "rave-wdt" }, { } }; MODULE_DEVICE_TABLE(i2c, ziirave_wdt_id); |
