diff options
author | Thomas Bogendoerfer <tbogendoerfer@suse.de> | 2019-03-28 09:37:45 -0400 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-03-28 14:37:41 -0400 |
commit | e4952b0c2c0309bdbfc4c6cc0dd81e37450d74d0 (patch) | |
tree | 2a77ea229e3eef59f764f9b3403615ecdc7603d5 | |
parent | ab8a6d821179ab9bea1a9179f535ccba6330c1ed (diff) |
MIPS: SGI-IP27: Fix use of unchecked pointer in shutdown_bridge_irq
smatch complaint:
arch/mips/sgi-ip27/ip27-irq.c:123 shutdown_bridge_irq()
warn: variable dereferenced before check 'hd' (see line 121)
Fix it by removing local variable and use hd->pin directly.
Fixes: 69a07a41d908 ("MIPS: SGI-IP27: rework HUB interrupts")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
-rw-r--r-- | arch/mips/sgi-ip27/ip27-irq.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c index 710a59764b01..a32f843cdbe0 100644 --- a/arch/mips/sgi-ip27/ip27-irq.c +++ b/arch/mips/sgi-ip27/ip27-irq.c | |||
@@ -118,7 +118,6 @@ static void shutdown_bridge_irq(struct irq_data *d) | |||
118 | { | 118 | { |
119 | struct hub_irq_data *hd = irq_data_get_irq_chip_data(d); | 119 | struct hub_irq_data *hd = irq_data_get_irq_chip_data(d); |
120 | struct bridge_controller *bc; | 120 | struct bridge_controller *bc; |
121 | int pin = hd->pin; | ||
122 | 121 | ||
123 | if (!hd) | 122 | if (!hd) |
124 | return; | 123 | return; |
@@ -126,7 +125,7 @@ static void shutdown_bridge_irq(struct irq_data *d) | |||
126 | disable_hub_irq(d); | 125 | disable_hub_irq(d); |
127 | 126 | ||
128 | bc = hd->bc; | 127 | bc = hd->bc; |
129 | bridge_clr(bc, b_int_enable, (1 << pin)); | 128 | bridge_clr(bc, b_int_enable, (1 << hd->pin)); |
130 | bridge_read(bc, b_wid_tflush); | 129 | bridge_read(bc, b_wid_tflush); |
131 | } | 130 | } |
132 | 131 | ||