From: Ajaykumar Hotchandani Date: Thu, 17 Nov 2016 14:16:13 +0000 (-0800) Subject: rds: fix warning in rds_send_drop_to() X-Git-Tag: v4.1.12-92~26^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7365e730a7ef15854333e46fc7a67936d0bcb59b;p=users%2Fjedix%2Flinux-maple.git 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 --- 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;