Re: [linux-next:master 13667/14048] drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 29, 2021 at 10:58 AM Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   593ef1658ecf61d3619885bdbbcfffa3d1417891
> commit: fa607fcb87f6e3dca38b9984c4ccde3e36a43721 [13667/14048] block/rnbd-clt: Support polling mode for IO latency optimization
> config: x86_64-randconfig-m031-20210420 (attached as .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 <lkp@xxxxxxxxx>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>
> smatch warnings:
> drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt'.
>
> vim +/cnt +2922 drivers/infiniband/ulp/rtrs/rtrs-clt.c
>
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2901  int rtrs_clt_rdma_cq_direct(struct rtrs_clt *clt, unsigned int index)
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2902  {
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2903       int cnt;
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2904       struct rtrs_con *con;
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2905       struct rtrs_clt_sess *sess;
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2906       struct path_it it;
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2907
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2908       rcu_read_lock();
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2909       for (path_it_init(&it, clt);
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2910            (sess = it.next_path(&it)) && it.i < it.clt->paths_num; it.i++) {
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2911               if (READ_ONCE(sess->state) != RTRS_CLT_CONNECTED)
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2912                       continue;
>
> What if no sessions are connected?  So we dont enter the loop or we
> hit continue every time?

Hi Dan,

I just finished a internal process for the fix of that issue.
In short, I would like to initialize cnt with -1.
So rtrs_clt_rdma_cq_direct will return -1 if there is no session.
And the block layer will not call rtrs_clt_rdma_cq_direct again
because the return value is negative.

I am going to send the patch today with the tags above.
Thank you very much.

>
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2913
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2914               con = sess->s.con[index + 1];
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2915               cnt = ib_process_cq_direct(con->cq, -1);
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2916               if (cnt)
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2917                       break;
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2918       }
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2919       path_it_deinit(&it);
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2920       rcu_read_unlock();
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2921
> fa607fcb87f6e3 Gioh Kim  2021-04-19 @2922       return cnt;
> fa607fcb87f6e3 Gioh Kim  2021-04-19  2923  }
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux