dm thin: fix discard support to a previously shared block
[firefly-linux-kernel-4.4.55.git] / net / sctp / output.c
index 0e2644d0a773710d149639ab3aa777c6313a7737..0fb140f8f088abe9421c401680731fb1c916a154 100644 (file)
@@ -581,7 +581,8 @@ int sctp_packet_transmit(struct sctp_packet *packet)
                unsigned long timeout;
 
                /* Restart the AUTOCLOSE timer when sending data. */
-               if (sctp_state(asoc, ESTABLISHED) && asoc->autoclose) {
+               if (sctp_state(asoc, ESTABLISHED) &&
+                   asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) {
                        timer = &asoc->timers[SCTP_EVENT_TIMEOUT_AUTOCLOSE];
                        timeout = asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE];