diff options
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 4c11b810a447..83c73bab2c3d 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -1109,6 +1109,10 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork, | |||
1109 | struct ip_options_rcu *opt; | 1109 | struct ip_options_rcu *opt; |
1110 | struct rtable *rt; | 1110 | struct rtable *rt; |
1111 | 1111 | ||
1112 | rt = *rtp; | ||
1113 | if (unlikely(!rt)) | ||
1114 | return -EFAULT; | ||
1115 | |||
1112 | /* | 1116 | /* |
1113 | * setup for corking. | 1117 | * setup for corking. |
1114 | */ | 1118 | */ |
@@ -1124,9 +1128,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork, | |||
1124 | cork->flags |= IPCORK_OPT; | 1128 | cork->flags |= IPCORK_OPT; |
1125 | cork->addr = ipc->addr; | 1129 | cork->addr = ipc->addr; |
1126 | } | 1130 | } |
1127 | rt = *rtp; | 1131 | |
1128 | if (unlikely(!rt)) | ||
1129 | return -EFAULT; | ||
1130 | /* | 1132 | /* |
1131 | * We steal reference to this route, caller should not release it | 1133 | * We steal reference to this route, caller should not release it |
1132 | */ | 1134 | */ |