@@ -2494,13 +2494,12 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job)
2494
2494
diag_status_reply = (struct diag_status * )
2495
2495
bsg_reply -> reply_data .vendor_reply .vendor_rsp ;
2496
2496
2497
- if (job -> reply_len <
2498
- sizeof (struct fc_bsg_request ) + sizeof (struct diag_status )) {
2497
+ if (job -> reply_len < sizeof (* bsg_reply ) + sizeof (* diag_status_reply )) {
2499
2498
lpfc_printf_log (phba , KERN_WARNING , LOG_LIBDFC ,
2500
2499
"3012 Received Run link diag test reply "
2501
2500
"below minimum size (%d): reply_len:%d\n" ,
2502
- (int )(sizeof (struct fc_bsg_request ) +
2503
- sizeof (struct diag_status )),
2501
+ (int )(sizeof (* bsg_reply ) +
2502
+ sizeof (* diag_status_reply )),
2504
2503
job -> reply_len );
2505
2504
rc = - EINVAL ;
2506
2505
goto job_error ;
@@ -3418,8 +3417,7 @@ lpfc_bsg_get_dfc_rev(struct bsg_job *job)
3418
3417
event_reply = (struct get_mgmt_rev_reply * )
3419
3418
bsg_reply -> reply_data .vendor_reply .vendor_rsp ;
3420
3419
3421
- if (job -> reply_len <
3422
- sizeof (struct fc_bsg_request ) + sizeof (struct get_mgmt_rev_reply )) {
3420
+ if (job -> reply_len < sizeof (* bsg_reply ) + sizeof (* event_reply )) {
3423
3421
lpfc_printf_log (phba , KERN_WARNING , LOG_LIBDFC ,
3424
3422
"2741 Received GET_DFC_REV reply below "
3425
3423
"minimum size\n" );
@@ -5202,8 +5200,8 @@ lpfc_menlo_cmd(struct bsg_job *job)
5202
5200
goto no_dd_data ;
5203
5201
}
5204
5202
5205
- if (job -> reply_len <
5206
- sizeof ( struct fc_bsg_request ) + sizeof (struct menlo_response )) {
5203
+ if (job -> reply_len < sizeof ( * bsg_reply ) +
5204
+ sizeof (struct menlo_response )) {
5207
5205
lpfc_printf_log (phba , KERN_WARNING , LOG_LIBDFC ,
5208
5206
"2785 Received MENLO_CMD reply below "
5209
5207
"minimum size\n" );
@@ -5359,9 +5357,7 @@ lpfc_forced_link_speed(struct bsg_job *job)
5359
5357
forced_reply = (struct forced_link_speed_support_reply * )
5360
5358
bsg_reply -> reply_data .vendor_reply .vendor_rsp ;
5361
5359
5362
- if (job -> reply_len <
5363
- sizeof (struct fc_bsg_request ) +
5364
- sizeof (struct forced_link_speed_support_reply )) {
5360
+ if (job -> reply_len < sizeof (* bsg_reply ) + sizeof (* forced_reply )) {
5365
5361
lpfc_printf_log (phba , KERN_WARNING , LOG_LIBDFC ,
5366
5362
"0049 Received FORCED_LINK_SPEED reply below "
5367
5363
"minimum size\n" );
@@ -5715,8 +5711,7 @@ lpfc_get_trunk_info(struct bsg_job *job)
5715
5711
event_reply = (struct lpfc_trunk_info * )
5716
5712
bsg_reply -> reply_data .vendor_reply .vendor_rsp ;
5717
5713
5718
- if (job -> reply_len <
5719
- sizeof (struct fc_bsg_request ) + sizeof (struct lpfc_trunk_info )) {
5714
+ if (job -> reply_len < sizeof (* bsg_reply ) + sizeof (* event_reply )) {
5720
5715
lpfc_printf_log (phba , KERN_WARNING , LOG_LIBDFC ,
5721
5716
"2728 Received GET TRUNK _INFO reply below "
5722
5717
"minimum size\n" );
0 commit comments