CC: [email protected]
CC: [email protected]
TO: Maor Gottlieb <[email protected]>
CC: Jason Gunthorpe <[email protected]>
CC: Leon Romanovsky <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   35632d92ef2daf36f75ddcd68d322c8ba7ad383c
commit: 831df88381f73bca0f5624b69ab985cac3d036bc RDMA/mlx5: Move all DM logic 
to separate file
date:   9 months ago
:::::: branch date: 2 hours ago
:::::: commit date: 9 months ago
config: i386-randconfig-m021-20220107 
(https://download.01.org/0day-ci/archive/20220108/[email protected]/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
drivers/infiniband/hw/mlx5/dm.c:239 mlx5_ib_alloc_dm() error: uninitialized 
symbol '_val'.

vim +/_val +239 drivers/infiniband/hw/mlx5/dm.c

831df88381f73b Maor Gottlieb 2021-04-11  229  
831df88381f73b Maor Gottlieb 2021-04-11  230  struct ib_dm 
*mlx5_ib_alloc_dm(struct ib_device *ibdev,
831df88381f73b Maor Gottlieb 2021-04-11  231                           struct 
ib_ucontext *context,
831df88381f73b Maor Gottlieb 2021-04-11  232                           struct 
ib_dm_alloc_attr *attr,
831df88381f73b Maor Gottlieb 2021-04-11  233                           struct 
uverbs_attr_bundle *attrs)
831df88381f73b Maor Gottlieb 2021-04-11  234  {
831df88381f73b Maor Gottlieb 2021-04-11  235    struct mlx5_ib_dm *dm;
831df88381f73b Maor Gottlieb 2021-04-11  236    enum mlx5_ib_uapi_dm_type type;
831df88381f73b Maor Gottlieb 2021-04-11  237    int err;
831df88381f73b Maor Gottlieb 2021-04-11  238  
831df88381f73b Maor Gottlieb 2021-04-11 @239    err = 
uverbs_get_const_default(&type, attrs,
831df88381f73b Maor Gottlieb 2021-04-11  240                                   
MLX5_IB_ATTR_ALLOC_DM_REQ_TYPE,
831df88381f73b Maor Gottlieb 2021-04-11  241                                   
MLX5_IB_UAPI_DM_TYPE_MEMIC);
831df88381f73b Maor Gottlieb 2021-04-11  242    if (err)
831df88381f73b Maor Gottlieb 2021-04-11  243            return ERR_PTR(err);
831df88381f73b Maor Gottlieb 2021-04-11  244  
831df88381f73b Maor Gottlieb 2021-04-11  245    mlx5_ib_dbg(to_mdev(ibdev), 
"alloc_dm req: dm_type=%d user_length=0x%llx log_alignment=%d\n",
831df88381f73b Maor Gottlieb 2021-04-11  246                type, attr->length, 
attr->alignment);
831df88381f73b Maor Gottlieb 2021-04-11  247  
831df88381f73b Maor Gottlieb 2021-04-11  248    err = 
check_dm_type_support(to_mdev(ibdev), type);
831df88381f73b Maor Gottlieb 2021-04-11  249    if (err)
831df88381f73b Maor Gottlieb 2021-04-11  250            return ERR_PTR(err);
831df88381f73b Maor Gottlieb 2021-04-11  251  
831df88381f73b Maor Gottlieb 2021-04-11  252    dm = kzalloc(sizeof(*dm), 
GFP_KERNEL);
831df88381f73b Maor Gottlieb 2021-04-11  253    if (!dm)
831df88381f73b Maor Gottlieb 2021-04-11  254            return ERR_PTR(-ENOMEM);
831df88381f73b Maor Gottlieb 2021-04-11  255  
831df88381f73b Maor Gottlieb 2021-04-11  256    dm->type = type;
831df88381f73b Maor Gottlieb 2021-04-11  257  
831df88381f73b Maor Gottlieb 2021-04-11  258    switch (type) {
831df88381f73b Maor Gottlieb 2021-04-11  259    case MLX5_IB_UAPI_DM_TYPE_MEMIC:
831df88381f73b Maor Gottlieb 2021-04-11  260            err = 
handle_alloc_dm_memic(context, dm,
831df88381f73b Maor Gottlieb 2021-04-11  261                                    
    attr,
831df88381f73b Maor Gottlieb 2021-04-11  262                                    
    attrs);
831df88381f73b Maor Gottlieb 2021-04-11  263            break;
831df88381f73b Maor Gottlieb 2021-04-11  264    case 
MLX5_IB_UAPI_DM_TYPE_STEERING_SW_ICM:
831df88381f73b Maor Gottlieb 2021-04-11  265            err = 
handle_alloc_dm_sw_icm(context, dm,
831df88381f73b Maor Gottlieb 2021-04-11  266                                    
     attr, attrs,
831df88381f73b Maor Gottlieb 2021-04-11  267                                    
     MLX5_SW_ICM_TYPE_STEERING);
831df88381f73b Maor Gottlieb 2021-04-11  268            break;
831df88381f73b Maor Gottlieb 2021-04-11  269    case 
MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_SW_ICM:
831df88381f73b Maor Gottlieb 2021-04-11  270            err = 
handle_alloc_dm_sw_icm(context, dm,
831df88381f73b Maor Gottlieb 2021-04-11  271                                    
     attr, attrs,
831df88381f73b Maor Gottlieb 2021-04-11  272                                    
     MLX5_SW_ICM_TYPE_HEADER_MODIFY);
831df88381f73b Maor Gottlieb 2021-04-11  273            break;
831df88381f73b Maor Gottlieb 2021-04-11  274    default:
831df88381f73b Maor Gottlieb 2021-04-11  275            err = -EOPNOTSUPP;
831df88381f73b Maor Gottlieb 2021-04-11  276    }
831df88381f73b Maor Gottlieb 2021-04-11  277  
831df88381f73b Maor Gottlieb 2021-04-11  278    if (err)
831df88381f73b Maor Gottlieb 2021-04-11  279            goto err_free;
831df88381f73b Maor Gottlieb 2021-04-11  280  
831df88381f73b Maor Gottlieb 2021-04-11  281    return &dm->ibdm;
831df88381f73b Maor Gottlieb 2021-04-11  282  
831df88381f73b Maor Gottlieb 2021-04-11  283  err_free:
831df88381f73b Maor Gottlieb 2021-04-11  284    kfree(dm);
831df88381f73b Maor Gottlieb 2021-04-11  285    return ERR_PTR(err);
831df88381f73b Maor Gottlieb 2021-04-11  286  }
831df88381f73b Maor Gottlieb 2021-04-11  287  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to