public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Md Haris Iqbal <haris.phnx@gmail.com>,
	linux-rdma@vger.kernel.org
Cc: lkp@intel.com, kbuild-all@lists.01.org, leon@kernel.org,
	jgg@ziepe.ca, haris.iqbal@ionos.com,
	Md Haris Iqbal <haris.phnx@gmail.com>
Subject: [kbuild] Re: [PATCH for-next] RDMA/rxe: rxe_get_av always receives ahp hence no put is needed
Date: Wed, 26 Oct 2022 12:37:33 +0300	[thread overview]
Message-ID: <202210252353.AQBJz0Bv-lkp@intel.com> (raw)
In-Reply-To: <20221020151345.412731-1-haris.phnx@gmail.com>

Hi Md,

https://git-scm.com/docs/git-format-patch#_base_tree_information  ]

url:    https://github.com/intel-lab-lkp/linux/commits/Md-Haris-Iqbal/RDMA-rxe-rxe_get_av-always-receives-ahp-hence-no-put-is-needed/20221020-231859  
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git   for-next
patch link:    https://lore.kernel.org/r/20221020151345.412731-1-haris.phnx%40gmail.com  
patch subject: [PATCH for-next] RDMA/rxe: rxe_get_av always receives ahp hence no put is needed
config: openrisc-randconfig-m041-20221024
compiler: or1k-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/infiniband/sw/rxe/rxe_av.c:133 rxe_get_av() error: we previously assumed 'ahp' could be null (see line 107)

vim +/ahp +133 drivers/infiniband/sw/rxe/rxe_av.c

63221acb0c6314 Bob Pearson 2022-03-03  102  struct rxe_av *rxe_get_av(struct rxe_pkt_info *pkt, struct rxe_ah **ahp)
8700e3e7c4857d Moni Shoua  2016-06-16  103  {
e2fe06c9080694 Bob Pearson 2021-10-07  104  	struct rxe_ah *ah;
e2fe06c9080694 Bob Pearson 2021-10-07  105  	u32 ah_num;
e2fe06c9080694 Bob Pearson 2021-10-07  106  
63221acb0c6314 Bob Pearson 2022-03-03 @107  	if (ahp)
                                                    ^^^
Check for NULL.  Maybe this check can be deleted.  It's never NULL in
the current code.

63221acb0c6314 Bob Pearson 2022-03-03  108  		*ahp = NULL;
63221acb0c6314 Bob Pearson 2022-03-03  109  
8700e3e7c4857d Moni Shoua  2016-06-16  110  	if (!pkt || !pkt->qp)
8700e3e7c4857d Moni Shoua  2016-06-16  111  		return NULL;
8700e3e7c4857d Moni Shoua  2016-06-16  112  
8700e3e7c4857d Moni Shoua  2016-06-16  113  	if (qp_type(pkt->qp) == IB_QPT_RC || qp_type(pkt->qp) == IB_QPT_UC)
8700e3e7c4857d Moni Shoua  2016-06-16  114  		return &pkt->qp->pri_av;
8700e3e7c4857d Moni Shoua  2016-06-16  115  
e2fe06c9080694 Bob Pearson 2021-10-07  116  	if (!pkt->wqe)
e2fe06c9080694 Bob Pearson 2021-10-07  117  		return NULL;
e2fe06c9080694 Bob Pearson 2021-10-07  118  
e2fe06c9080694 Bob Pearson 2021-10-07  119  	ah_num = pkt->wqe->wr.wr.ud.ah_num;
e2fe06c9080694 Bob Pearson 2021-10-07  120  	if (ah_num) {
                                                    ^^^^^^
Perhaps it is a false positive if checking "ah_num" is intended to be
equivalent to checking "ahp"?

e2fe06c9080694 Bob Pearson 2021-10-07  121  		/* only new user provider or kernel client */
e2fe06c9080694 Bob Pearson 2021-10-07  122  		ah = rxe_pool_get_index(&pkt->rxe->ah_pool, ah_num);
63221acb0c6314 Bob Pearson 2022-03-03  123  		if (!ah) {
e2fe06c9080694 Bob Pearson 2021-10-07  124  			pr_warn("Unable to find AH matching ah_num\n");
e2fe06c9080694 Bob Pearson 2021-10-07  125  			return NULL;
e2fe06c9080694 Bob Pearson 2021-10-07  126  		}
63221acb0c6314 Bob Pearson 2022-03-03  127  
63221acb0c6314 Bob Pearson 2022-03-03  128  		if (rxe_ah_pd(ah) != pkt->qp->pd) {
63221acb0c6314 Bob Pearson 2022-03-03  129  			pr_warn("PDs don't match for AH and QP\n");
3197706abd0532 Bob Pearson 2022-03-03  130  			rxe_put(ah);
63221acb0c6314 Bob Pearson 2022-03-03  131  			return NULL;
63221acb0c6314 Bob Pearson 2022-03-03  132  		}
63221acb0c6314 Bob Pearson 2022-03-03 @133  		*ahp = ah;
                                                        ^^^^
Unchecked dereference.

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp  


      parent reply	other threads:[~2022-10-26  9:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 15:13 [PATCH for-next] RDMA/rxe: rxe_get_av always receives ahp hence no put is needed Md Haris Iqbal
2022-10-21  5:58 ` Bob Pearson
2022-10-26  9:37 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202210252353.AQBJz0Bv-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=haris.iqbal@ionos.com \
    --cc=haris.phnx@gmail.com \
    --cc=jgg@ziepe.ca \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox