From nobody Thu Nov 28 05:30:07 2024 Received: from msa.smtpout.orange.fr (msa-215.smtpout.orange.fr [193.252.23.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D39C11A76CF; Thu, 3 Oct 2024 19:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.252.23.215 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727984059; cv=none; b=o4rqntPRGKWSqwobIIO/EkKsRCWOzGv70qsMLkySCS25nkCcYLlE9p2ct4soxMqD8+j0hjW0/wZWtMrdEUBStb9VzHDAqkpa9qTp4onJilhVqe7k76MQPI3PvxICx52hcv2EDDGUXtJhU5ru44Aw5DTe1RmZoUGx7SbfDsWvGLE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727984059; c=relaxed/simple; bh=WyZWEWlhds0xrBVDq7MOYOUjniUReyXJlQLd/zaY5tE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ugoZ7BoOl2NpuLmkazhiK0X6HEsXxuM2S8OLtkhkyt6zXgz3K5uIHPIo1ztLEqmNe0PFZmKiXcnvdwsJxmCwGeYRJnHCBHImdn48hQnizvRAqdlVodJZzDE7E+tniRIlqJwu6oO71eUXjP+kHr69dgJNYwPyjADGlrlbuTjmeSw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=nU6efexJ; arc=none smtp.client-ip=193.252.23.215 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="nU6efexJ" Received: from fedora.home ([90.11.132.44]) by smtp.orange.fr with ESMTPA id wRaPsP5U3vjJewRaQsN4s2; Thu, 03 Oct 2024 21:34:07 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1727984047; bh=2SDPvfeI4Lzg8Uj2ZPpyRvlMXWAOYBlC3P/o4uoQmrY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=nU6efexJ2AzkRnAdtD4BvewOlLJBUkfpSsJpWrc+misqdWwPWs8ZEOMrxMZ6/jwqr E/wuAgK2Tu985JV2ummHBR+zWsXPnz84ADc9O/ZEngzDnwkDuSm9tWsGaTxoFtAeO8 7O4pW6NB2VHzxUdNHeWDeJHFVPAi321xpNXQexkg0J9PZMiVXQa5eyPr1pOEGC0/Rd SkkJFtsq0RLTKjdzMHlMz2Vv1IJq8Qa67W7r/dLilY23+VwqtE4B3cpNhb43d3IgXR s0HoI/eZi6HlyeU7RKgifP8ZiQ0lKdPYBzcYAuS24s1UhtWx4cV7ELjyd/c+6TzN7v kODvm3gRFZJGg== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 03 Oct 2024 21:34:07 +0200 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: Jaroslav Kysela , Takashi Iwai , Takashi Sakamoto Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , Takashi Iwai , linux-sound@vger.kernel.org Subject: [PATCH] ALSA: gus: Fix some error handling paths related to get_bpos() usage Date: Thu, 3 Oct 2024 21:34:01 +0200 Message-ID: X-Mailer: git-send-email 2.46.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If get_bpos() fails, it is likely that the corresponding error code should be returned. Fixes: a6970bb1dd99 ("ALSA: gus: Convert to the new PCM ops") Signed-off-by: Christophe JAILLET --- This patch is speculative. Review with care. --- sound/isa/gus/gus_pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index bcbcaa924c12..16f9bbb43a54 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c @@ -364,7 +364,7 @@ static int snd_gf1_pcm_playback_copy(struct snd_pcm_sub= stream *substream, =20 bpos =3D get_bpos(pcmp, voice, pos, len); if (bpos < 0) - return pos; + return bpos; if (copy_from_iter(runtime->dma_area + bpos, len, src) !=3D len) return -EFAULT; return playback_copy_ack(substream, bpos, len); @@ -381,7 +381,7 @@ static int snd_gf1_pcm_playback_silence(struct snd_pcm_= substream *substream, =09 bpos =3D get_bpos(pcmp, voice, pos, len); if (bpos < 0) - return pos; + return bpos; snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos, bytes_to_samples(runtime, count)); return playback_copy_ack(substream, bpos, len); --=20 2.46.2