@@ -183,7 +183,6 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb,
183
183
sizeof (struct gtp0_header );
184
184
struct gtp0_header * gtp0 ;
185
185
struct pdp_ctx * pctx ;
186
- int ret = 0 ;
187
186
188
187
if (!pskb_may_pull (skb , hdrlen ))
189
188
return -1 ;
@@ -196,26 +195,19 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb,
196
195
if (gtp0 -> type != GTP_TPDU )
197
196
return 1 ;
198
197
199
- rcu_read_lock ();
200
198
pctx = gtp0_pdp_find (gtp , be64_to_cpu (gtp0 -> tid ));
201
199
if (!pctx ) {
202
200
netdev_dbg (gtp -> dev , "No PDP ctx to decap skb=%p\n" , skb );
203
- ret = -1 ;
204
- goto out_rcu ;
201
+ return -1 ;
205
202
}
206
203
207
204
if (!gtp_check_src_ms (skb , pctx , hdrlen )) {
208
205
netdev_dbg (gtp -> dev , "No PDP ctx for this MS\n" );
209
- ret = -1 ;
210
- goto out_rcu ;
206
+ return -1 ;
211
207
}
212
- rcu_read_unlock ();
213
208
214
209
/* Get rid of the GTP + UDP headers. */
215
210
return iptunnel_pull_header (skb , hdrlen , skb -> protocol , xnet );
216
- out_rcu :
217
- rcu_read_unlock ();
218
- return ret ;
219
211
}
220
212
221
213
static int gtp1u_udp_encap_recv (struct gtp_dev * gtp , struct sk_buff * skb ,
@@ -225,7 +217,6 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb,
225
217
sizeof (struct gtp1_header );
226
218
struct gtp1_header * gtp1 ;
227
219
struct pdp_ctx * pctx ;
228
- int ret = 0 ;
229
220
230
221
if (!pskb_may_pull (skb , hdrlen ))
231
222
return -1 ;
@@ -253,26 +244,19 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb,
253
244
254
245
gtp1 = (struct gtp1_header * )(skb -> data + sizeof (struct udphdr ));
255
246
256
- rcu_read_lock ();
257
247
pctx = gtp1_pdp_find (gtp , ntohl (gtp1 -> tid ));
258
248
if (!pctx ) {
259
249
netdev_dbg (gtp -> dev , "No PDP ctx to decap skb=%p\n" , skb );
260
- ret = -1 ;
261
- goto out_rcu ;
250
+ return -1 ;
262
251
}
263
252
264
253
if (!gtp_check_src_ms (skb , pctx , hdrlen )) {
265
254
netdev_dbg (gtp -> dev , "No PDP ctx for this MS\n" );
266
- ret = -1 ;
267
- goto out_rcu ;
255
+ return -1 ;
268
256
}
269
- rcu_read_unlock ();
270
257
271
258
/* Get rid of the GTP + UDP headers. */
272
259
return iptunnel_pull_header (skb , hdrlen , skb -> protocol , xnet );
273
- out_rcu :
274
- rcu_read_unlock ();
275
- return ret ;
276
260
}
277
261
278
262
static void gtp_encap_disable (struct gtp_dev * gtp )
0 commit comments