[PATCH 10/10] SAP: Remove not needed checks from disconnect_ind

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 00c540e..c83e68a 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;
-- 
on behalf of ST-Ericsson

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux