Hi Nilesh, I love your patch! Perhaps something to improve: [auto build test WARNING on be1b500212541a70006887bae558ff834d7365d0] url: https://github.com/0day-ci/linux/commits/Nilesh-Javali/qla2xxx-driver-enhancements/20201223-171449 base: be1b500212541a70006887bae558ff834d7365d0 config: arm-randconfig-r003-20201229 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/0day-ci/linux/commit/91215cb3603060400922e6d25eebb732dc0e4e7a git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Nilesh-Javali/qla2xxx-driver-enhancements/20201223-171449 git checkout 91215cb3603060400922e6d25eebb732dc0e4e7a # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All warnings (new ones prefixed by >>): >> drivers/scsi/qla2xxx/qla_bsg.c:2657:3: warning: variable 'data' is uninitialized when used here [-Wuninitialized] data->status = EXT_STATUS_BUFFER_TOO_SMALL; ^~~~ drivers/scsi/qla2xxx/qla_bsg.c:2627:36: note: initialize the variable 'data' to silence this warning struct ql_vnd_tgt_stats_resp *data; ^ = NULL 1 warning generated. vim +/data +2657 drivers/scsi/qla2xxx/qla_bsg.c 2617 2618 static int 2619 qla2x00_get_tgt_stats(struct bsg_job *bsg_job) 2620 { 2621 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); 2622 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 2623 struct ql_vnd_tgt_stats_param *req_data; 2624 u32 req_data_len; 2625 int ret = 0; 2626 u64 response_len = 0; 2627 struct ql_vnd_tgt_stats_resp *data; 2628 struct fc_rport *rport = NULL; 2629 2630 if (!vha->flags.online) { 2631 ql_log(ql_log_warn, vha, 0x0000, "Host is not online.\n"); 2632 return -EIO; 2633 } 2634 2635 req_data_len = bsg_job->request_payload.payload_len; 2636 2637 if (req_data_len != sizeof(struct ql_vnd_stat_entry)) { 2638 ql_log(ql_log_warn, vha, 0x0000, "req_data_len invalid.\n"); 2639 return -EIO; 2640 } 2641 2642 req_data = kzalloc(sizeof(*req_data), GFP_KERNEL); 2643 if (!req_data) { 2644 ql_log(ql_log_warn, vha, 0x0000, "req_data memory allocation failure.\n"); 2645 return -ENOMEM; 2646 } 2647 2648 /* Copy the request buffer in req_data */ 2649 sg_copy_to_buffer(bsg_job->request_payload.sg_list, 2650 bsg_job->request_payload.sg_cnt, 2651 req_data, req_data_len); 2652 2653 response_len = sizeof(struct ql_vnd_tgt_stats_resp) + 2654 sizeof(struct ql_vnd_stat_entry); 2655 2656 if (response_len > bsg_job->reply_payload.payload_len) { > 2657 data->status = EXT_STATUS_BUFFER_TOO_SMALL; 2658 bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = EXT_STATUS_BUFFER_TOO_SMALL; 2659 bsg_job->reply_payload.payload_len = sizeof(struct ql_vnd_mng_host_stats_resp); 2660 2661 bsg_reply->reply_payload_rcv_len = 2662 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, 2663 bsg_job->reply_payload.sg_cnt, &data, 2664 sizeof(struct ql_vnd_tgt_stats_resp)); 2665 2666 bsg_reply->result = DID_OK; 2667 bsg_job_done(bsg_job, bsg_reply->result, 2668 bsg_reply->reply_payload_rcv_len); 2669 goto tgt_stat_out; 2670 } 2671 2672 /* structure + size for one entry */ 2673 data = kzalloc(response_len, GFP_KERNEL); 2674 if (!data) { 2675 kfree(req_data); 2676 return -ENOMEM; 2677 } 2678 2679 rport = qla2xxx_find_rport(vha, req_data->tgt_id); 2680 if (!rport) { 2681 ql_log(ql_log_warn, vha, 0x0000, "target %d not found.\n", req_data->tgt_id); 2682 ret = EXT_STATUS_INVALID_PARAM; 2683 data->status = EXT_STATUS_INVALID_PARAM; 2684 goto reply; 2685 } 2686 2687 ret = qla2xxx_get_tgt_stats(fc_bsg_to_shost(bsg_job), req_data->stat_type, 2688 rport, (void *)data, response_len); 2689 2690 bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = EXT_STATUS_OK; 2691 reply: 2692 bsg_reply->reply_payload_rcv_len = 2693 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, 2694 bsg_job->reply_payload.sg_cnt, data, 2695 response_len); 2696 bsg_reply->result = DID_OK; 2697 bsg_job_done(bsg_job, bsg_reply->result, 2698 bsg_reply->reply_payload_rcv_len); 2699 2700 kfree(data); 2701 tgt_stat_out: 2702 kfree(req_data); 2703 2704 return ret; 2705 } 2706 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip