From a9262df671e0dcb8c91443ffbab209296eb5e5b5 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 25 May 2012 16:21:02 +0200 Subject: [PATCH] SAP: Remove not needed checks from disconnect_ind disconnect_ind is an helper funtion and is always called with valid connection and from valid state so there is no need to double check that. --- sap/server.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sap/server.c b/sap/server.c index 00c540ea2..c83e68a88 100644 --- a/sap/server.c +++ b/sap/server.c @@ -274,18 +274,8 @@ static int disconnect_ind(void *sap_device, uint8_t disc_type) struct sap_parameter *param = (struct sap_parameter *) msg->param; size_t size = sizeof(struct sap_message); - if (!conn) - return -EINVAL; - DBG("data %p state %d disc_type 0x%02x", conn, conn->state, disc_type); - if (conn->state != SAP_STATE_GRACEFUL_DISCONNECT && - conn->state != SAP_STATE_IMMEDIATE_DISCONNECT) { - error("Processing error (state %d pr 0x%02x)", conn->state, - conn->processing_req); - return -EPERM; - } - memset(buf, 0, sizeof(buf)); msg->id = SAP_DISCONNECT_IND; msg->nparam = 0x01; -- 2.47.3