From 7365e730a7ef15854333e46fc7a67936d0bcb59b Mon Sep 17 00:00:00 2001 From: Ajaykumar Hotchandani Date: Thu, 17 Nov 2016 06:16:13 -0800 Subject: [PATCH] rds: fix warning in rds_send_drop_to() This fixes following warning: warning: 'conn' may be used uninitialized in this function Orabug: 25116517 Signed-off-by: Ajaykumar Hotchandani --- net/rds/send.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/rds/send.c b/net/rds/send.c index a15759099650..36897d781fa8 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -865,7 +865,7 @@ EXPORT_SYMBOL_GPL(rds_send_drop_acked); void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest) { struct rds_message *rm, *tmp; - struct rds_connection *conn; + struct rds_connection *conn = NULL; unsigned long flags; LIST_HEAD(list); int conn_dropped = 0; @@ -935,7 +935,7 @@ void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest) * For a paticular dest and for a sock, all the rms cancelled * belong to the same connection. */ - if (!conn_dropped && dest && + if (conn && !conn_dropped && dest && test_bit(RDS_MSG_MAPPED, &rm->m_flags)) { rds_conn_drop(conn, DR_SOCK_CANCEL); conn_dropped = 1; -- 2.50.1