projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d8bee6
)
dst: catch uninitialized metrics
author
Stephen Hemminger
<shemminger@vyatta.com>
Tue, 24 May 2011 17:50:52 +0000
(13:50 -0400)
committer
David S. Miller
<davem@davemloft.net>
Tue, 24 May 2011 17:50:52 +0000
(13:50 -0400)
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>
include/net/dst.h
patch
|
blob
|
history
diff --git
a/include/net/dst.h
b/include/net/dst.h
index 07a0402c52e6b3cec976652d7aa0c3d4a101d955..7d15d238b6ecc4f3d4c47af4389525ead0f7a2c7 100644
(file)
--- 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);