From: Stephen Hemminger Date: Tue, 24 May 2011 17:50:52 +0000 (-0400) Subject: dst: catch uninitialized metrics X-Git-Tag: v3.0-rc2~7^2~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f37070d3ff325827c6213e51b57f21fd5ac9d05;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git dst: catch uninitialized metrics Catch cases where dst_metric_set() and other functions are called but _metrics is NULL. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/include/net/dst.h b/include/net/dst.h index 07a0402..7d15d23 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -111,6 +111,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);