From e640ff65d531f76194af63054205a125b2e4518d Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 16 May 2008 21:13:57 +0100 Subject: [PATCH] --- yaml --- r: 97324 b: refs/heads/master c: 4cc58bdebfcb7561de401999705a5cde16674842 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/sfc/boards.c | 9 +++------ trunk/include/net/netlink.h | 11 +++++------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 62f5bd096b86..909c1728ffa8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b9a2f2e450b0f770bb4347ae8d48eb2dea701e24 +refs/heads/master: 4cc58bdebfcb7561de401999705a5cde16674842 diff --git a/trunk/drivers/net/sfc/boards.c b/trunk/drivers/net/sfc/boards.c index eecaa6d58584..7fc0328dc055 100644 --- a/trunk/drivers/net/sfc/boards.c +++ b/trunk/drivers/net/sfc/boards.c @@ -27,10 +27,8 @@ static void blink_led_timer(unsigned long context) struct efx_blinker *bl = &efx->board_info.blinker; efx->board_info.set_fault_led(efx, bl->state); bl->state = !bl->state; - if (bl->resubmit) { - bl->timer.expires = jiffies + BLINK_INTERVAL; - add_timer(&bl->timer); - } + if (bl->resubmit) + mod_timer(&bl->timer, jiffies + BLINK_INTERVAL); } static void board_blink(struct efx_nic *efx, int blink) @@ -44,8 +42,7 @@ static void board_blink(struct efx_nic *efx, int blink) blinker->state = 0; setup_timer(&blinker->timer, blink_led_timer, (unsigned long)efx); - blinker->timer.expires = jiffies + BLINK_INTERVAL; - add_timer(&blinker->timer); + mod_timer(&blinker->timer, jiffies + BLINK_INTERVAL); } else { blinker->resubmit = 0; if (blinker->timer.function) diff --git a/trunk/include/net/netlink.h b/trunk/include/net/netlink.h index 112dcdf7e34e..a5506c42f03c 100644 --- a/trunk/include/net/netlink.h +++ b/trunk/include/net/netlink.h @@ -772,13 +772,12 @@ static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype, const struct nla_policy *policy, int len) { - int nested_len = nla_len(nla) - NLA_ALIGN(len); - - if (nested_len < 0) + if (nla_len(nla) < len) return -1; - if (nested_len >= nla_attr_size(0)) - return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len), - nested_len, policy); + if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr)) + return nla_parse_nested(tb, maxtype, + nla_data(nla) + NLA_ALIGN(len), + policy); memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); return 0; }