Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f37070d authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller
Browse files

dst: catch uninitialized metrics



Catch cases where dst_metric_set() and other functions are called
but _metrics is NULL.

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5d8bee67
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);