Skip to contentSkip to conversation

fs: dlm: uninitialized variable on error in dlm_listen_for_all()

PATCH New Dan Carpenter 1 participant 1 message Jan 15, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: dlm: uninitialized variable on error in dlm_listen_for_all()

The "sock" variable is not initialized on this error path.

Cc stable at vger.kernel.org
Fixes 2dc6b1158c28 ("fs: dlm: introduce generic listen")
---
 fs/dlm/lowcomms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/dlm/lowcomms.c +1 -1
index e284d696c1fd..6ed935ad8247 100644
@@ -1789,7 +1789,7 @@ static int dlm_listen_for_all(void)
 				  SOCK_STREAM, dlm_proto_ops->proto, &sock);
 	if (result < 0) {
 		log_print("Can't create comms socket: %d", result);
-		goto out;
+		return result;
 	}
 
 	sock_set_mark(sock->sk, dlm_config.ci_mark);
Signature · 1 line
2.20.1