All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cheng Xu <chengyou@linux.alibaba.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [bug report] RDMA/erdma: Add verbs implementation
Date: Thu, 9 Jun 2022 10:32:18 +0800	[thread overview]
Message-ID: <b1908852-9dee-1ff2-e46d-4c1fc6667c22@linux.alibaba.com> (raw)
In-Reply-To: <YqCcf36CtN3IwXpo@kili>



On 6/8/22 8:56 PM, Dan Carpenter wrote:
> Hello Cheng Xu,
> 
> The patch c4612e83c14b: "RDMA/erdma: Add verbs implementation" from
> May 23, 2022, leads to the following Smatch static checker warning:
> 
> 	drivers/infiniband/hw/erdma/erdma_verbs.c:111 create_qp_cmd()
> 	error: uninitialized symbol 'resp0'.
> 
> drivers/infiniband/hw/erdma/erdma_verbs.c
>      100                 req.sq_buf_addr = user_qp->sq_mtt.mtt_entry[0];
>      101                 req.rq_buf_addr = user_qp->rq_mtt.mtt_entry[0];
>      102
>      103                 req.sq_db_info_dma_addr = user_qp->sq_db_info_dma_addr;
>      104                 req.rq_db_info_dma_addr = user_qp->rq_db_info_dma_addr;
>      105         }
>      106
>      107         err = erdma_post_cmd_wait(&dev->cmdq, (u64 *)&req, sizeof(req), &resp0,
>      108                                   &resp1);
> 
> The erdma_post_cmd_wait() function does not initialize erdma_post_cmd_wait()
> on the error paths.

Oh, I knew this before: since erdma_post_cmd_wait returns error, the qp
's resource will destroy soon, the uninitialized value of resp0 will
influence nothing. So here I reduce a condition judgement.

Anyway, I will fix it to eliminate the static checker warning.


> Also it returns comp_wait->comp_status which is a u8.  I guess that's
> some kind of custom error code.  Mixing kernel and custom error codes
> is dangerous.  I think it's a bug in this case.
> 

I will fix it in the next version of our patches.

Thanks,
Cheng Xu



  reply	other threads:[~2022-06-09  2:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08 12:56 [bug report] RDMA/erdma: Add verbs implementation Dan Carpenter
2022-06-09  2:32 ` Cheng Xu [this message]
2022-06-09  6:57   ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2023-09-06 11:27 Dan Carpenter
2023-09-08  6:09 ` Cheng Xu

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=b1908852-9dee-1ff2-e46d-4c1fc6667c22@linux.alibaba.com \
    --to=chengyou@linux.alibaba.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-rdma@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.