audio/avrcp: Remove not needed null check in
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
@@ -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
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@@ -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