diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-11-22 13:13:54 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-09 10:20:00 +0100 |
commit | aea6343885a67cd0ff69cba720c7e8538e78cc40 (patch) | |
tree | bfee06d4d8b7df60426255559b9bfb8fa2985cc6 /sound | |
parent | ebf3afa3cbd1778131af012531a0f7cc896c6621 (diff) | |
download | linux-stable-aea6343885a67cd0ff69cba720c7e8538e78cc40.tar.gz linux-stable-aea6343885a67cd0ff69cba720c7e8538e78cc40.tar.bz2 linux-stable-aea6343885a67cd0ff69cba720c7e8538e78cc40.zip |
ALSA: cs4236: fix error return comparison of an unsigned integer
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/isa/cs423x/cs4236.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index 78dd213589b4..fa3c39cff5f8 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c @@ -278,7 +278,8 @@ static int snd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev) } 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 */ |