[3.13.y.z extended stable] Patch "irqchip: armada-370-xp: fix invalid cast of signed value into unsigned variable" has been added to staging queue
Kamal Mostafa
kamal at canonical.com
Tue Jun 10 19:01:45 UTC 2014
This is a note to let you know that I have just added a patch titled
irqchip: armada-370-xp: fix invalid cast of signed value into unsigned variable
to the linux-3.13.y-queue branch of the 3.13.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.13.y-queue
This patch is scheduled to be released in version 3.13.11.3.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.13.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
------
>From 290f338e833b8cbc520eb6827b701ef40791f371 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Date: Fri, 18 Apr 2014 14:19:47 +0200
Subject: irqchip: armada-370-xp: fix invalid cast of signed value into
unsigned variable
commit da343fc776e0bcb238b65d9d24610819b95d0ef4 upstream.
The armada_370_xp_alloc_msi() function returns a signed int, which is
negative on error. However, we store the return value into an
irq_hw_number_t, which is unsigned. Therefore, we actually never test
if armada_370_xp_alloc_msi() returns an error or not, which may lead
us to use hwirq numbers of as 0xffffffe4 (when
armada_370_xp_alloc_msi() returns -ENOSPC).
This commit fixes that by storing the return value of
armada_370_xp_alloc_msi() in a signed variable.
Fixes: 31f614edb726fcc4d5aa0f2895fbdec9b04a3ca4 ('irqchip: armada-370-xp: implement MSI support')
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Link: https://lkml.kernel.org/r/1397823593-1932-2-git-send-email-thomas.petazzoni@free-electrons.com
Tested-by: Neil Greatorex <neil at fatboyfat.co.uk>
Signed-off-by: Jason Cooper <jason at lakedaemon.net>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
drivers/irqchip/irq-armada-370-xp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index 3fac063..79eb0d1 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -132,8 +132,7 @@ static int armada_370_xp_setup_msi_irq(struct msi_chip *chip,
struct msi_desc *desc)
{
struct msi_msg msg;
- irq_hw_number_t hwirq;
- int virq;
+ int virq, hwirq;
hwirq = armada_370_xp_alloc_msi();
if (hwirq < 0)
--
1.9.1
More information about the kernel-team
mailing list