Skip to contentSkip to conversation

audio/avrcp: Remove not needed null check in

PATCH Applied Szymon Janc 2 participants 2 messages Sep 22, 2015 – Sep 23, 2015 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 audio/avrcp: Remove not needed null check in

Browsing handlers are always getting valid pdu pointer so there is no need to double check that. Also pdu pointer is already dereferenced before calling handler.

---
 profiles/audio/avrcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
profiles/audio/avrcp.c +1 -1
index 53170ec..24deac5 100644
@@ -1946,7 +1946,7 @@ static void avrcp_handle_get_folder_items(struct avrcp *session,
 	uint8_t scope;
 	uint8_t status = AVRCP_STATUS_SUCCESS;
 
-	if (!pdu || ntohs(pdu->param_len) < 10) {
+	if (ntohs(pdu->param_len) < 10) {
 		status = AVRCP_STATUS_INVALID_PARAM;
 		goto failed;
 	}
Signature · 1 line
2.5.0
maintainer Applied
#1 lore raw

Hi Szymon,

Quoted 21 lines · Szymon Janc

Browsing handlers are always getting valid pdu pointer so there is no need to double check that. Also pdu pointer is already dereferenced before calling handler.

---
 profiles/audio/avrcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
profiles/audio/avrcp.c +1 -2
index 53170ec..24deac5 100644
@@ -1946,7 +1946,7 @@ static void avrcp_handle_get_folder_items(struct avrcp *session,
        uint8_t scope;
        uint8_t status = AVRCP_STATUS_SUCCESS;
 
-       if (!pdu || ntohs(pdu->param_len) < 10) {
+       if (ntohs(pdu->param_len) < 10) {
                status = AVRCP_STATUS_INVALID_PARAM;
                goto failed;
        }
--
Quoted 1 line

2.5.0

Applied, thanks.

Signature · 1 line
Luiz Augusto von Dentz