Skip to content

Commit

Permalink
MIPS: SGI-IP27: Fix use of unchecked pointer in shutdown_bridge_irq
Browse files Browse the repository at this point in the history
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: 69a07a4 ("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
  • Loading branch information
Thomas Bogendoerfer authored and Paul Burton committed Mar 28, 2019
1 parent ab8a6d8 commit e4952b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/mips/sgi-ip27/ip27-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,14 @@ static void shutdown_bridge_irq(struct irq_data *d)
{
struct hub_irq_data *hd = irq_data_get_irq_chip_data(d);
struct bridge_controller *bc;
int pin = hd->pin;

if (!hd)
return;

disable_hub_irq(d);

bc = hd->bc;
bridge_clr(bc, b_int_enable, (1 << pin));
bridge_clr(bc, b_int_enable, (1 << hd->pin));
bridge_read(bc, b_wid_tflush);
}

Expand Down

0 comments on commit e4952b0

Please sign in to comment.