Linux bluetooth development
 help / color / mirror / Atom feed
From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Subject: [PATCH_v4 10/12] android/hid: Handle invalid parameters in HAL
Date: Tue,  5 Nov 2013 23:09:16 +0200	[thread overview]
Message-ID: <1383685758-3900-11-git-send-email-ravikumar.veeramally@linux.intel.com> (raw)
In-Reply-To: <1383685758-3900-1-git-send-email-ravikumar.veeramally@linux.intel.com>

---
 android/hal-hidhost.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index fe68fe7..815902b 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -204,9 +204,8 @@ static bt_status_t hh_get_protocol(bt_bdaddr_t *bd_addr,
 	case BTHH_BOOT_MODE:
 		cmd.mode = HAL_HID_BOOT_PROTOCOL;
 		break;
-	case BTHH_UNSUPPORTED_MODE:
-		cmd.mode = HAL_HID_UNSUPPORTED_PROTOCOL;
-		break;
+	default:
+		return BT_STATUS_PARM_INVALID;
 	}
 
 	return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST,
@@ -236,9 +235,8 @@ static bt_status_t hh_set_protocol(bt_bdaddr_t *bd_addr,
 	case BTHH_BOOT_MODE:
 		cmd.mode = HAL_HID_BOOT_PROTOCOL;
 		break;
-	case BTHH_UNSUPPORTED_MODE:
-		cmd.mode = HAL_HID_UNSUPPORTED_PROTOCOL;
-		break;
+	default:
+		return BT_STATUS_PARM_INVALID;
 	}
 
 	return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST,
@@ -275,6 +273,8 @@ static bt_status_t hh_get_report(bt_bdaddr_t *bd_addr,
 	case BTHH_FEATURE_REPORT:
 		cmd.type = HAL_HID_FEATURE_REPORT;
 		break;
+	default:
+		return BT_STATUS_PARM_INVALID;
 	}
 
 	return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HID_GET_REPORT,
@@ -309,6 +309,8 @@ static bt_status_t hh_set_report(bt_bdaddr_t *bd_addr,
 	case BTHH_FEATURE_REPORT:
 		cmd.type = HAL_HID_FEATURE_REPORT;
 		break;
+	default:
+		return BT_STATUS_PARM_INVALID;
 	}
 
 	return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HID_SET_REPORT,
-- 
1.8.1.2


  parent reply	other threads:[~2013-11-05 21:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05 21:09 [PATCH_v4 00/12] Implemented hid interfaces in daemon and HAL Ravi kumar Veeramally
2013-11-05 21:09 ` [PATCH_v4 01/12] android/hid: Implement hid get protocol in daemon Ravi kumar Veeramally
2013-11-05 21:09 ` [PATCH_v4 02/12] android/hid: Implement hid set " Ravi kumar Veeramally
2013-11-05 21:09 ` [PATCH_v4 03/12] android/hid: Handle protocol mode notification in HAL Ravi kumar Veeramally
2013-11-05 21:09 ` [PATCH_v4 04/12] android/hid: Add hid event get report structure to HAL msg headers Ravi kumar Veeramally
2013-11-05 21:09 ` [PATCH_v4 05/12] android/hid: Implement hid get report in daemon Ravi kumar Veeramally
2013-11-05 21:09 ` [PATCH_v4 06/12] android/hid: Add missing set report parameters to ipc document Ravi kumar Veeramally
2013-11-05 21:09 ` [PATCH_v4 07/12] android/hid: Implement hid set report in daemon Ravi kumar Veeramally
2013-11-05 21:09 ` [PATCH_v4 08/12] android/hid: Handle get report notification in HAL Ravi kumar Veeramally
2013-11-05 21:09 ` [PATCH_v4 09/12] android/hid: Replace header checking magic number with defines Ravi kumar Veeramally
2013-11-05 21:09 ` Ravi kumar Veeramally [this message]
2013-11-05 21:09 ` [PATCH_v4 11/12] android/hid: Handle uhid events Ravi kumar Veeramally
2013-11-05 21:09 ` [PATCH_v4 12/12] android/hid: Align hal hid struct variables properly Ravi kumar Veeramally
2013-11-06  8:37 ` [PATCH_v4 00/12] Implemented hid interfaces in daemon and HAL Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383685758-3900-11-git-send-email-ravikumar.veeramally@linux.intel.com \
    --to=ravikumar.veeramally@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox