Hello Karan Tilak Kumar, Commit a63e78eb2b0f ("scsi: fnic: Add support for fabric based solicited requests and responses") from Dec 11, 2024 (linux-next), leads to the following Smatch static checker warning: drivers/scsi/fnic/fnic_main.c:907 fnic_probe() warn: missing error code 'err' drivers/scsi/fnic/fnic_main.c 866 867 err = fnic_alloc_vnic_resources(fnic); 868 if (err) { 869 dev_err(&fnic->pdev->dev, "Failed to alloc vNIC resources, " 870 "aborting.\n"); 871 goto err_out_fnic_alloc_vnic_res; 872 } 873 dev_info(&fnic->pdev->dev, "fnic copy wqs: %d, Q0 ioreq table size: %d\n", 874 fnic->wq_copy_count, fnic->sw_copy_wq[0].ioreq_table_size); 875 876 /* initialize all fnic locks */ 877 spin_lock_init(&fnic->fnic_lock); 878 879 for (i = 0; i < FNIC_WQ_MAX; i++) 880 spin_lock_init(&fnic->wq_lock[i]); 881 882 for (i = 0; i < FNIC_WQ_COPY_MAX; i++) { 883 spin_lock_init(&fnic->wq_copy_lock[i]); 884 fnic->wq_copy_desc_low[i] = DESC_CLEAN_LOW_WATERMARK; 885 fnic->fw_ack_recd[i] = 0; 886 fnic->fw_ack_index[i] = -1; 887 } 888 889 pool = mempool_create_slab_pool(2, fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]); 890 if (!pool) 891 goto err_out_free_resources; err = -ENOMEM; 892 fnic->io_sgl_pool[FNIC_SGL_CACHE_DFLT] = pool; 893 894 pool = mempool_create_slab_pool(2, fnic_sgl_cache[FNIC_SGL_CACHE_MAX]); 895 if (!pool) 896 goto err_out_free_dflt_pool; err = -ENOMEM; 897 fnic->io_sgl_pool[FNIC_SGL_CACHE_MAX] = pool; 898 899 pool = mempool_create_slab_pool(FDLS_MIN_FRAMES, fdls_frame_cache); 900 if (!pool) 901 goto err_out_fdls_frame_pool; err = -ENOMEM; 902 fnic->frame_pool = pool; 903 904 pool = mempool_create_slab_pool(FDLS_MIN_FRAME_ELEM, 905 fdls_frame_elem_cache); 906 if (!pool) --> 907 goto err_out_fdls_frame_elem_pool; err = -ENOMEM; regards, dan carpenter 908 fnic->frame_elem_pool = pool; 909 910 /* setup vlan config, hw inserts vlan header */ 911 fnic->vlan_hw_insert = 1; 912 fnic->vlan_id = 0; 913 914 if (fnic->config.flags & VFCF_FIP_CAPABLE) { 915 dev_info(&fnic->pdev->dev, "firmware supports FIP\n"); 916 /* enable directed and multicast */ 917 vnic_dev_packet_filter(fnic->vdev, 1, 1, 0, 0, 0); 918 vnic_dev_add_addr(fnic->vdev, FIP_ALL_ENODE_MACS); 919 vnic_dev_add_addr(fnic->vdev, iport->hwmac); 920 spin_lock_init(&fnic->vlans_lock); 921 INIT_WORK(&fnic->fip_frame_work, fnic_handle_fip_frame); 922 INIT_LIST_HEAD(&fnic->fip_frame_queue); 923 INIT_LIST_HEAD(&fnic->vlan_list); 924 timer_setup(&fnic->retry_fip_timer, fnic_handle_fip_timer, 0); 925 timer_setup(&fnic->fcs_ka_timer, fnic_handle_fcs_ka_timer, 0); 926 timer_setup(&fnic->enode_ka_timer, fnic_handle_enode_ka_timer, 0); 927 timer_setup(&fnic->vn_ka_timer, fnic_handle_vn_ka_timer, 0); 928 fnic->set_vlan = fnic_set_vlan; 929 } else { 930 dev_info(&fnic->pdev->dev, "firmware uses non-FIP mode\n"); 931 } 932 fnic->state = FNIC_IN_FC_MODE; 933 934 atomic_set(&fnic->in_flight, 0); 935 fnic->state_flags = FNIC_FLAGS_NONE; 936 937 /* Enable hardware stripping of vlan header on ingress */ 938 fnic_set_nic_config(fnic, 0, 0, 0, 0, 0, 0, 1); 939 940 /* Setup notification buffer area */ 941 err = fnic_notify_set(fnic); 942 if (err) { 943 dev_err(&fnic->pdev->dev, "Failed to alloc notify buffer, aborting.\n"); 944 goto err_out_fnic_notify_set; 945 } 946 [ snip ] 1048 1049 return 0; 1050 1051 err_out_free_stats_debugfs: 1052 fnic_stats_debugfs_remove(fnic); 1053 scsi_remove_host(fnic->host); 1054 err_out_scsi_drv_init: 1055 fnic_free_intr(fnic); 1056 err_out_fnic_request_intr: 1057 err_out_alloc_rq_buf: 1058 for (i = 0; i < fnic->rq_count; i++) { 1059 if (ioread32(&fnic->rq[i].ctrl->enable)) 1060 vnic_rq_disable(&fnic->rq[i]); 1061 vnic_rq_clean(&fnic->rq[i], fnic_free_rq_buf); 1062 } 1063 vnic_dev_notify_unset(fnic->vdev); 1064 err_out_fnic_notify_set: 1065 mempool_destroy(fnic->frame_elem_pool); 1066 err_out_fdls_frame_elem_pool: 1067 mempool_destroy(fnic->frame_pool); 1068 err_out_fdls_frame_pool: 1069 mempool_destroy(fnic->io_sgl_pool[FNIC_SGL_CACHE_MAX]); 1070 err_out_free_dflt_pool: 1071 mempool_destroy(fnic->io_sgl_pool[FNIC_SGL_CACHE_DFLT]); 1072 err_out_free_resources: 1073 fnic_free_vnic_resources(fnic); 1074 err_out_fnic_alloc_vnic_res: 1075 fnic_clear_intr_mode(fnic); 1076 err_out_fnic_set_intr_mode: 1077 if (IS_FNIC_FCP_INITIATOR(fnic)) 1078 scsi_host_put(fnic->host); 1079 err_out_fnic_role: 1080 err_out_scsi_host_alloc: 1081 err_out_fnic_get_config: 1082 err_out_dev_mac_addr: 1083 err_out_dev_init: 1084 vnic_dev_close(fnic->vdev); 1085 err_out_dev_open: 1086 err_out_dev_cmd_init: 1087 vnic_dev_unregister(fnic->vdev); 1088 err_out_dev_register: 1089 fnic_iounmap(fnic); 1090 err_out_fnic_map_bar: 1091 err_out_map_bar: 1092 err_out_set_dma_mask: 1093 pci_release_regions(pdev); 1094 err_out_pci_request_regions: 1095 pci_disable_device(pdev); 1096 err_out_pci_enable_device: 1097 ida_free(&fnic_ida, fnic->fnic_num); 1098 err_out_ida_alloc: 1099 kfree(fnic); 1100 err_out_fnic_alloc: 1101 return err; 1102 } regards, dan carpenter