diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-05-24 13:50:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-03 09:31:58 +0900 |
commit | 6de88839e47b4cb4dc97b095a2a89399fbec8a23 (patch) | |
tree | 9d1e42d2423a22d6df9b65752d34b67fbcf52be6 /include | |
parent | 88bb492456d6ba8c860060d08fc1370a8ce979b0 (diff) |
dst: catch uninitialized metrics
[ Upstream commit 1f37070d3ff325827c6213e51b57f21fd5ac9d05 ]
Catch cases where dst_metric_set() and other functions are called
but _metrics is NULL.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/dst.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index 75b95df4afe..b3ad020faec 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -120,6 +120,8 @@ static inline u32 *dst_metrics_write_ptr(struct dst_entry *dst) { unsigned long p = dst->_metrics; + BUG_ON(!p); + if (p & DST_METRICS_READ_ONLY) return dst->ops->cow_metrics(dst, p); return __DST_METRICS_PTR(p); |