Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[POWERPC] mpic_pasemi_msi: Failed allocation unnoticed

bitmap_find_free_region(), called by mpic_msi_alloc_hwirqs() may return
signed, but hwirq is unsigned. A failed allocation remains unnoticed.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Roel Kluin and committed by
Paul Mackerras
ee1a08f9 54ef0ec2

+4 -2
+4 -2
arch/powerpc/sysdev/mpic_pasemi_msi.c
··· 95 95 unsigned int virq; 96 96 struct msi_desc *entry; 97 97 struct msi_msg msg; 98 + int ret; 98 99 99 100 pr_debug("pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n", 100 101 pdev, nvec, type); ··· 109 108 * few MSIs for someone, but restrictions will apply to how the 110 109 * sources can be changed independently. 111 110 */ 112 - hwirq = mpic_msi_alloc_hwirqs(msi_mpic, ALLOC_CHUNK); 113 - if (hwirq < 0) { 111 + ret = mpic_msi_alloc_hwirqs(msi_mpic, ALLOC_CHUNK); 112 + hwirq = ret; 113 + if (ret < 0) { 114 114 pr_debug("pasemi_msi: failed allocating hwirq\n"); 115 115 return hwirq; 116 116 }