Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 2021 13:09:45 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 721b795b721b - main - ibcore: Don't allocate method table, if already present.
Message-ID:  <202107121309.16CD9jCj095202@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=721b795b721b349db5e6198f8681d5992447c775

commit 721b795b721b349db5e6198f8681d5992447c775
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2021-06-16 13:01:48 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2021-07-12 12:22:32 +0000

    ibcore: Don't allocate method table, if already present.
    
    This commit aligns the code in question with upstream Linux.
    
    Linux commit:
    2468b82d69e3a53d024f28d79ba0fdb8bf43dfbf
    
    MFC after:      1 week
    Reviewed by:    kib
    Sponsored by:   Mellanox Technologies // NVIDIA Networking
---
 sys/ofed/drivers/infiniband/core/ib_mad.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sys/ofed/drivers/infiniband/core/ib_mad.c b/sys/ofed/drivers/infiniband/core/ib_mad.c
index 5b1297fe4cd3..82a3f19d92bb 100644
--- a/sys/ofed/drivers/infiniband/core/ib_mad.c
+++ b/sys/ofed/drivers/infiniband/core/ib_mad.c
@@ -1554,8 +1554,11 @@ static int add_oui_reg_req(struct ib_mad_reg_req *mad_reg_req,
 			method = &(*vendor_table)->vendor_class[
 				vclass]->method_table[i];
 			/* Allocate method table for this OUI */
-			if ((ret = allocate_method_table(method)))
-				goto error3;
+			if (!*method) {
+				ret = allocate_method_table(method);
+				if (ret)
+					goto error3;
+			}
 			memcpy((*vendor_table)->vendor_class[vclass]->oui[i],
 			       mad_reg_req->oui, 3);
 			goto check_in_use;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107121309.16CD9jCj095202>