From: Mukesh Ojha <mojha@codeaurora.org>
To: Thomas Bogendoerfer <tbogendoerfer@suse.de>,
Ralf Baechle <ralf@linux-mips.org>,
Paul Burton <paul.burton@mips.com>,
James Hogan <jhogan@kernel.org>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH] MIPS: SGI-IP27: Fix use of unchecked pointer in shutdown_bridge_irq
Date: Thu, 28 Mar 2019 20:12:16 +0530 [thread overview]
Message-ID: <1050e38e-c6e5-167e-fdf1-c60a3928ea72@codeaurora.org> (raw)
In-Reply-To: <20190328133745.26506-1-tbogendoerfer@suse.de>
On 3/28/2019 7:07 PM, Thomas Bogendoerfer wrote:
> 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>
-Mukesh
> ---
> arch/mips/sgi-ip27/ip27-irq.c | 3 +--
> 1 file changed, 1 insertion(+), 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)
> {
> struct hub_irq_data *hd = irq_data_get_irq_chip_data(d);
> struct bridge_controller *bc;
> - int pin = hd->pin;
>
> if (!hd)
> return;
> @@ -126,7 +125,7 @@ static void shutdown_bridge_irq(struct irq_data *d)
> 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);
> }
>
next prev parent reply other threads:[~2019-03-28 14:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-28 13:37 Thomas Bogendoerfer
2019-03-28 14:42 ` Mukesh Ojha [this message]
2019-03-28 18:37 ` Paul Burton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1050e38e-c6e5-167e-fdf1-c60a3928ea72@codeaurora.org \
--to=mojha@codeaurora.org \
--cc=dan.carpenter@oracle.com \
--cc=jhogan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=paul.burton@mips.com \
--cc=ralf@linux-mips.org \
--cc=tbogendoerfer@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®