From 8507c4b773cebaba9673f0a0a29aedffa0c0feda Mon Sep 17 00:00:00 2001 From: zhuoliang zhang Date: Thu, 16 Jul 2020 23:54:10 +0800 Subject: [PATCH] [ALPS05211149] net:fix ubsan warning [Detail] ubsan tool report the null pointer on the function: ip_rt_put ;but the function tell caller it may accepts a NULL parameter; [solution] bypass ubsan check MTK-Commit-Id: a27e154b8c4d0e6bd31f3275677ee45f10d03723 Change-Id: I9b20bb91d31545f57e3da061ff11fd092d3bbe1e Signed-off-by: zhuoliang zhang CR-Id: ALPS05211149 Feature: [Module]IP Networking --- include/net/route.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/route.h b/include/net/route.h index 1ab8b6f82812..239ffb61897b 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -231,7 +231,7 @@ void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); void rt_add_uncached_list(struct rtable *rt); void rt_del_uncached_list(struct rtable *rt); -static inline void ip_rt_put(struct rtable *rt) +static inline void __attribute__((no_sanitize("null"))) ip_rt_put(struct rtable *rt) { /* dst_release() accepts a NULL parameter. * We rely on dst being first structure in struct rtable