From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D0A5C43460 for ; Thu, 29 Apr 2021 09:05:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8CB2B61481 for ; Thu, 29 Apr 2021 09:05:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CB2B61481 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ionos.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CD9FC6B006C; Thu, 29 Apr 2021 05:05:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C89D16B006E; Thu, 29 Apr 2021 05:05:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B03156B0070; Thu, 29 Apr 2021 05:05:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 9012B6B006C for ; Thu, 29 Apr 2021 05:05:43 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4BEEB181251AF for ; Thu, 29 Apr 2021 09:05:43 +0000 (UTC) X-FDA: 78084821766.02.F4DDF30 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by imf11.hostedemail.com (Postfix) with ESMTP id 5DE462000250 for ; Thu, 29 Apr 2021 09:05:27 +0000 (UTC) Received: by mail-ej1-f51.google.com with SMTP id u17so98853101ejk.2 for ; Thu, 29 Apr 2021 02:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+5q7ITQeMXl3dtd/b89lj/JahrrdWASC00gb0ETgmLs=; b=ceoty/UnklMmrmjHLy9rMHEwZ7efU/xxMQIXXGORu/9Mz3L+imBQHBWU9yrpSh4m2l LAYvInsoK7NfsJzbH8TN5ZAgkuvsJOEtqmDhUJuO2ZOG+WrrRpA2asf55HfFbV4QMirS 7RmScIrtnYp7Sb8P2KGT1yi/rujf8a7xPsW8w3VVAO20gpDiy4NHZiklCgISkNoHuTgy fAVPfMa5TsZYJAJVwAkFOu9l8oIR+YL5ZiVWswaGoJDjVZWQab8hqcRYerVb8O+GMQ1U utNOsfcHhhOOxjOi6KPWCDpOwVNyu5BxPdDk1Q9evcSYMsC9Bf6c5vEvdmnzHdzGmFd1 PDtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+5q7ITQeMXl3dtd/b89lj/JahrrdWASC00gb0ETgmLs=; b=HZlHmKui7A1kpNl5F7JJCGbsK5kmGgqSitup4PhlT07u29K0eImphmmUZkpKMOmXcG 3t7hSVU0DPjxpn7KHxSjks3uT3lOo64xLbMMMy4thuQdbVaC9L67WeYgyREQZPYt6F0i l4qahBwBmyOa5bkyF0pLAB1C7vwYjK6Zg9ZuMQSTMaMCtTolcJAXKG2GL/YKQJ2mYxf6 Ez2/0eIKEVEBnMJpC3YCYl/EDCffzW67VzjGiuIKQVYdfUxSIJu6GazOhD6DatPYmzc+ zeptUrxy9W/89lAhmzZLJdK82PKCV7OiTaVfa0Cr3Gsywl7qGMQQ8u5tEhASAmcFA39l zpuQ== X-Gm-Message-State: AOAM531RYiC2S4NpDKGgYm/Ygjc5ZnF8t0/8IbofbIm43WKAJZKl3rG6 yU9GvkZkQG9lFNNEY5XIlJBJFzVofzn6yrY09H2a8Q== X-Google-Smtp-Source: ABdhPJz0GG7dOMj7qefZaxco0KinybVcqFLsNF6rVulLuCZJwhJ8DC+uYBpASlaxNE8tQqq5sqshAuk6Y8t1T3akzhg= X-Received: by 2002:a17:906:3b13:: with SMTP id g19mr22783927ejf.238.1619687141385; Thu, 29 Apr 2021 02:05:41 -0700 (PDT) MIME-Version: 1.0 References: <202104211107.klEwvRy0-lkp@intel.com> In-Reply-To: <202104211107.klEwvRy0-lkp@intel.com> From: Gioh Kim Date: Thu, 29 Apr 2021 11:05:05 +0200 Message-ID: Subject: Re: [linux-next:master 13667/14048] drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt'. To: Dan Carpenter Cc: kbuild@lists.01.org, Gioh Kim , kbuild test robot , kbuild-all@lists.01.org, Linux Memory Management List , Jens Axboe , Jack Wang , Leon Romanovsky Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 5DE462000250 X-Stat-Signature: uzjfgmjtmstot8wyojsyd61jgcwa1cud Received-SPF: none (ionos.com>: No applicable sender policy available) receiver=imf11; identity=mailfrom; envelope-from=""; helo=mail-ej1-f51.google.com; client-ip=209.85.218.51 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619687127-376398 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Apr 29, 2021 at 10:58 AM Dan Carpenter 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 > Reported-by: Dan Carpenter > > 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@lists.01.org >