Forwarded: [PATCH] RDMA/rtrs-clt: guard against null kobj name

syzbot <[email protected]>
Newsgroups gmane.linux.kernel
Message-ID <[email protected]>
For archival purposes, forwarding an incoming command email to
[email protected].

***

Subject: [PATCH] RDMA/rtrs-clt: guard against null kobj name
Author: [email protected]

#syz test

Signed-off-by: Ryan Mehri <[email protected]>
---
 drivers/infiniband/ulp/rtrs/rtrs-clt-trace.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt-trace.h b/drivers/infiniband/ulp/rtrs/rtrs-clt-trace.h
index 7738e2676855..33bf6215d26c 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt-trace.h
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt-trace.h
@@ -55,7 +55,8 @@ DECLARE_EVENT_CLASS(rtrs_clt_conn_class,
 		__entry->max_reconnect_attempts = clt->max_reconnect_attempts;
 		__entry->fail_cnt = clt_path->stats->reconnects.fail_cnt;
 		__entry->success_cnt = clt_path->stats->reconnects.successful_cnt;
-		memcpy(__entry->sessname, kobject_name(&clt_path->kobj), NAME_MAX);
+		if (kobject_name(&clt_path->kobj))
+			memcpy(__entry->sessname, kobject_name(&clt_path->kobj), NAME_MAX);
 	),
 
 	TP_printk("RTRS-CLT: sess='%s' state=%s attempts='%d' max-attempts='%d' fail='%d' success='%d'",
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.