Return-Path: From: Lucas De Marchi To: linux-bluetooth@vger.kernel.org Cc: Lucas De Marchi Subject: [PATCH 06/12] AVRCP: Do not list values for unsupported attributes Date: Wed, 12 Oct 2011 12:11:16 -0300 Message-Id: <1318432282-25002-6-git-send-email-lucas.demarchi@profusion.mobi> In-Reply-To: <1318432282-25002-1-git-send-email-lucas.demarchi@profusion.mobi> References: <1318432282-25002-1-git-send-email-lucas.demarchi@profusion.mobi> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: --- audio/avrcp.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/audio/avrcp.c b/audio/avrcp.c index 6bddf5b..a7987fb 100644 --- a/audio/avrcp.c +++ b/audio/avrcp.c @@ -565,11 +565,10 @@ static uint8_t avrcp_handle_list_player_values(struct avrcp_player *player, if (len != 1 || !player) goto err; - len = attr_get_max_val(pdu->params[0]); - if (!len) { - error("Attribute is invalid: %u", pdu->params[0]); + if (player_get_attribute(player, pdu->params[0]) < 0) goto err; - } + + len = attr_get_max_val(pdu->params[0]); for (i = 1; i <= len; i++) pdu->params[i] = i; -- 1.7.7