]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jan 2020 20:09:14 +0000 (21:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jan 2020 20:09:14 +0000 (21:09 +0100)
added patches:
alsa-cs4236-fix-error-return-comparison-of-an-unsigned-integer.patch

queue-4.9/alsa-cs4236-fix-error-return-comparison-of-an-unsigned-integer.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/alsa-cs4236-fix-error-return-comparison-of-an-unsigned-integer.patch b/queue-4.9/alsa-cs4236-fix-error-return-comparison-of-an-unsigned-integer.patch
new file mode 100644 (file)
index 0000000..131ab0d
--- /dev/null
@@ -0,0 +1,37 @@
+From d60229d84846a8399257006af9c5444599f64361 Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king@canonical.com>
+Date: Fri, 22 Nov 2019 13:13:54 +0000
+Subject: ALSA: cs4236: fix error return comparison of an unsigned integer
+
+From: Colin Ian King <colin.king@canonical.com>
+
+commit d60229d84846a8399257006af9c5444599f64361 upstream.
+
+The return from pnp_irq is an unsigned integer type resource_size_t
+and hence the error check for a positive non-error code is always
+going to be true.  A check for a non-failure return from pnp_irq
+should in fact be for (resource_size_t)-1 rather than >= 0.
+
+Addresses-Coverity: ("Unsigned compared against 0")
+Fixes: a9824c868a2c ("[ALSA] Add CS4232 PnP BIOS support")
+Signed-off-by: Colin Ian King <colin.king@canonical.com>
+Link: https://lore.kernel.org/r/20191122131354.58042-1-colin.king@canonical.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/isa/cs423x/cs4236.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/sound/isa/cs423x/cs4236.c
++++ b/sound/isa/cs423x/cs4236.c
+@@ -293,7 +293,8 @@ static int snd_cs423x_pnp_init_mpu(int d
+       } else {
+               mpu_port[dev] = pnp_port_start(pdev, 0);
+               if (mpu_irq[dev] >= 0 &&
+-                  pnp_irq_valid(pdev, 0) && pnp_irq(pdev, 0) >= 0) {
++                  pnp_irq_valid(pdev, 0) &&
++                  pnp_irq(pdev, 0) != (resource_size_t)-1) {
+                       mpu_irq[dev] = pnp_irq(pdev, 0);
+               } else {
+                       mpu_irq[dev] = -1;      /* disable interrupt */
index 7c5fddc6d703fdb071470893b068d86fdf64b395..5113cc575de815754c4931d5acd5738f9d3125ba 100644 (file)
@@ -27,3 +27,4 @@ ata-libahci_platform-export-again-ahci_platform_-en-dis-able_phys.patch
 ata-ahci_brcm-fix-ahci-resources-management.patch
 gpiolib-fix-up-emulated-open-drain-outputs.patch
 tracing-have-the-histogram-compare-functions-convert-to-u64-first.patch
+alsa-cs4236-fix-error-return-comparison-of-an-unsigned-integer.patch