* [PATCH] infiniband: hw: cxgb4: fix error return code of pass_open_rpl()
@ 2021-03-06 13:53 Jia-Ju Bai
2021-03-07 9:12 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2021-03-06 13:53 UTC (permalink / raw)
To: bharat, dledford, jgg; +Cc: linux-rdma, linux-kernel, Jia-Ju Bai
When ep is NULL, no error code of pass_open_rpl() is returned.
To fix this bug, pass_open_rpl() returns -EINVAL in this case.
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
drivers/infiniband/hw/cxgb4/cm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 8769e7aa097f..773d3805bb25 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -2382,7 +2382,7 @@ static int pass_open_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
if (!ep) {
pr_warn("%s stid %d lookup failure!\n", __func__, stid);
- goto out;
+ return -EINVAL;
}
pr_debug("ep %p status %d error %d\n", ep,
rpl->status, status2errno(rpl->status));
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] infiniband: hw: cxgb4: fix error return code of pass_open_rpl()
2021-03-06 13:53 [PATCH] infiniband: hw: cxgb4: fix error return code of pass_open_rpl() Jia-Ju Bai
@ 2021-03-07 9:12 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2021-03-07 9:12 UTC (permalink / raw)
To: Jia-Ju Bai; +Cc: bharat, dledford, jgg, linux-rdma, linux-kernel
On Sat, Mar 06, 2021 at 05:53:17AM -0800, Jia-Ju Bai wrote:
> When ep is NULL, no error code of pass_open_rpl() is returned.
> To fix this bug, pass_open_rpl() returns -EINVAL in this case.
Why do you think that this is an error?
>
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> ---
> drivers/infiniband/hw/cxgb4/cm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
> index 8769e7aa097f..773d3805bb25 100644
> --- a/drivers/infiniband/hw/cxgb4/cm.c
> +++ b/drivers/infiniband/hw/cxgb4/cm.c
> @@ -2382,7 +2382,7 @@ static int pass_open_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
>
> if (!ep) {
> pr_warn("%s stid %d lookup failure!\n", __func__, stid);
> - goto out;
> + return -EINVAL;
> }
> pr_debug("ep %p status %d error %d\n", ep,
> rpl->status, status2errno(rpl->status));
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-07 9:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-06 13:53 [PATCH] infiniband: hw: cxgb4: fix error return code of pass_open_rpl() Jia-Ju Bai
2021-03-07 9:12 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox