@@ -365,15 +365,16 @@ static void ipc_mux_dl_cmd_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
365
365
/* Pass the DL packet to the netif layer. */
366
366
static int ipc_mux_net_receive (struct iosm_mux * ipc_mux , int if_id ,
367
367
struct iosm_wwan * wwan , u32 offset ,
368
- u8 service_class , struct sk_buff * skb )
368
+ u8 service_class , struct sk_buff * skb ,
369
+ u32 pkt_len )
369
370
{
370
371
struct sk_buff * dest_skb = skb_clone (skb , GFP_ATOMIC );
371
372
372
373
if (!dest_skb )
373
374
return - ENOMEM ;
374
375
375
376
skb_pull (dest_skb , offset );
376
- skb_set_tail_pointer (dest_skb , dest_skb -> len );
377
+ skb_trim (dest_skb , pkt_len );
377
378
/* Pass the packet to the netif layer. */
378
379
dest_skb -> priority = service_class ;
379
380
@@ -429,7 +430,7 @@ static void ipc_mux_dl_fcth_decode(struct iosm_mux *ipc_mux,
429
430
static void ipc_mux_dl_adgh_decode (struct iosm_mux * ipc_mux ,
430
431
struct sk_buff * skb )
431
432
{
432
- u32 pad_len , packet_offset ;
433
+ u32 pad_len , packet_offset , adgh_len ;
433
434
struct iosm_wwan * wwan ;
434
435
struct mux_adgh * adgh ;
435
436
u8 * block = skb -> data ;
@@ -470,10 +471,12 @@ static void ipc_mux_dl_adgh_decode(struct iosm_mux *ipc_mux,
470
471
packet_offset = sizeof (* adgh ) + pad_len ;
471
472
472
473
if_id += ipc_mux -> wwan_q_offset ;
474
+ adgh_len = le16_to_cpu (adgh -> length );
473
475
474
476
/* Pass the packet to the netif layer */
475
477
rc = ipc_mux_net_receive (ipc_mux , if_id , wwan , packet_offset ,
476
- adgh -> service_class , skb );
478
+ adgh -> service_class , skb ,
479
+ adgh_len - packet_offset );
477
480
if (rc ) {
478
481
dev_err (ipc_mux -> dev , "mux adgh decoding error" );
479
482
return ;
@@ -547,7 +550,7 @@ static int mux_dl_process_dg(struct iosm_mux *ipc_mux, struct mux_adbh *adbh,
547
550
int if_id , int nr_of_dg )
548
551
{
549
552
u32 dl_head_pad_len = ipc_mux -> session [if_id ].dl_head_pad_len ;
550
- u32 packet_offset , i , rc ;
553
+ u32 packet_offset , i , rc , dg_len ;
551
554
552
555
for (i = 0 ; i < nr_of_dg ; i ++ , dg ++ ) {
553
556
if (le32_to_cpu (dg -> datagram_index )
@@ -562,11 +565,12 @@ static int mux_dl_process_dg(struct iosm_mux *ipc_mux, struct mux_adbh *adbh,
562
565
packet_offset =
563
566
le32_to_cpu (dg -> datagram_index ) +
564
567
dl_head_pad_len ;
568
+ dg_len = le16_to_cpu (dg -> datagram_length );
565
569
/* Pass the packet to the netif layer. */
566
570
rc = ipc_mux_net_receive (ipc_mux , if_id , ipc_mux -> wwan ,
567
571
packet_offset ,
568
- dg -> service_class ,
569
- skb );
572
+ dg -> service_class , skb ,
573
+ dg_len - dl_head_pad_len );
570
574
if (rc )
571
575
goto dg_error ;
572
576
}
@@ -1207,10 +1211,9 @@ static int mux_ul_dg_update_tbl_index(struct iosm_mux *ipc_mux,
1207
1211
qlth_n_ql_size , ul_list );
1208
1212
ipc_mux_ul_adb_finish (ipc_mux );
1209
1213
if (ipc_mux_ul_adb_allocate (ipc_mux , adb , & ipc_mux -> size_needed ,
1210
- IOSM_AGGR_MUX_SIG_ADBH )) {
1211
- dev_kfree_skb (src_skb );
1214
+ IOSM_AGGR_MUX_SIG_ADBH ))
1212
1215
return - ENOMEM ;
1213
- }
1216
+
1214
1217
ipc_mux -> size_needed = le32_to_cpu (adb -> adbh -> block_length );
1215
1218
1216
1219
ipc_mux -> size_needed += offsetof(struct mux_adth , dg );
@@ -1471,8 +1474,7 @@ void ipc_mux_ul_encoded_process(struct iosm_mux *ipc_mux, struct sk_buff *skb)
1471
1474
ipc_mux -> ul_data_pend_bytes );
1472
1475
1473
1476
/* Reset the skb settings. */
1474
- skb -> tail = 0 ;
1475
- skb -> len = 0 ;
1477
+ skb_trim (skb , 0 );
1476
1478
1477
1479
/* Add the consumed ADB to the free list. */
1478
1480
skb_queue_tail ((& ipc_mux -> ul_adb .free_list ), skb );
0 commit comments