mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
ipv6: fix return value check in fib6_add()
[ Upstream commit f950c0ecc7
]
In case of error, the function fib6_add_1() returns ERR_PTR()
or NULL pointer. The ERR_PTR() case check is missing in fib6_add().
dpatch engine is used to generated this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d5e36b089e
commit
410eafac65
1 changed files with 4 additions and 0 deletions
|
@ -818,6 +818,10 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
|
|||
offsetof(struct rt6_info, rt6i_src),
|
||||
allow_create, replace_required);
|
||||
|
||||
if (IS_ERR(sn)) {
|
||||
err = PTR_ERR(sn);
|
||||
sn = NULL;
|
||||
}
|
||||
if (!sn) {
|
||||
/* If it is failed, discard just allocated
|
||||
root, and then (in st_failure) stale node
|
||||
|
|
Loading…
Reference in a new issue