[PATCH rdma-core 1/2] srp_daemon: Print the correct device name for error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

gcc 9.1 says:

../srp_daemon/srp_daemon.c:682:3: warning: '%s' directive argument is null [-Wformat-overflow=]

The intention here was the print the input string not NULL.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 srp_daemon/srp_daemon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index baf4957a618905..a004f6a407e08c 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -679,8 +679,7 @@ static int translate_umad_to_ibdev_and_port(char *umad_dev, char **ibdev,
 
 	umad_dev_name = rindex(umad_dev, '/');
 	if (!umad_dev_name) {
-		pr_err("Couldn't find device name in '%s'\n",
-			umad_dev_name);
+		pr_err("Couldn't find device name in '%s'\n", umad_dev);
 		return -1;
 	}
 
-- 
2.21.0




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux