From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752979AbcJ2LnD (ORCPT ); Sat, 29 Oct 2016 07:43:03 -0400 Received: from mx1.polytechnique.org ([129.104.30.34]:55185 "EHLO mx1.polytechnique.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750748AbcJ2LnA (ORCPT ); Sat, 29 Oct 2016 07:43:00 -0400 From: Nicolas Iooss To: Clemens Ladisch , Takashi Sakamoto , alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, Nicolas Iooss Subject: [PATCH 1/1] ALSA: bebob: use the right string length in check_audiophile_booted() Date: Sat, 29 Oct 2016 13:41:25 +0200 Message-Id: <20161029114125.20481-1-nicolas.iooss_linux@m4x.org> X-Mailer: git-send-email 2.10.1 X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Sat Oct 29 13:42:58 2016 +0200 (CEST)) X-Spam-Flag: No, tests=bogofilter, spamicity=0.000000, queueID=5CFA0564684 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function check_audiophile_booted() only compares 15 characters of the 24-character-long string "FW Audiophile Bootloader" with the firmware model name. As this seems to be incorrect and because there is no comment explaining this "15", fix the length which is used in strncmp(). This patch has only been compile-tested. Fixes: 9076c22ddd9d ("ALSA: bebob: Add support for M-Audio usual Firewire series") Signed-off-by: Nicolas Iooss --- sound/firewire/bebob/bebob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c index 3469ac14c89c..b23cd0901553 100644 --- a/sound/firewire/bebob/bebob.c +++ b/sound/firewire/bebob/bebob.c @@ -177,7 +177,7 @@ check_audiophile_booted(struct fw_unit *unit) if (fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)) < 0) return false; - return strncmp(name, "FW Audiophile Bootloader", 15) != 0; + return strncmp(name, "FW Audiophile Bootloader", 24) != 0; } static void -- 2.10.1