From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Matthias Brugger <matthias.bgg@gmail.com>,
Pan Bian <bianpan2016@163.com>,
linux-usb@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mathias Nyman <mathias.nyman@intel.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"moderated list:ARM/Mediatek SoC..."
<linux-mediatek@lists.infradead.org>,
Chunfeng Yun <chunfeng.yun@mediatek.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] usb: return error code when platform_get_irq fails
Date: Wed, 30 Nov 2016 16:05:59 +0200 [thread overview]
Message-ID: <583EDCC7.20702@linux.intel.com> (raw)
In-Reply-To: <52a774c0-9bca-6d1b-a470-f07caefa5d3a@gmail.com>
On 30.11.2016 15:41, Matthias Brugger wrote:
>
>
> On 29/11/16 13:57, Pan Bian wrote:
>> In function xhci_mtk_probe(), variable ret takes the return value. Its
>> value should be negative on failures. However, when the call to function
>> platform_get_irq() fails, it does not set the error code, and 0 will be
>> returned. 0 indicates no error. As a result, the callers of function
>> xhci_mtk_probe() will not be able to detect the error. This patch fixes
>> the bug by assigning the return value of platform_get_irq() to variable
>> ret if it fails.
>>
>> Signed-off-by: Pan Bian <bianpan2016@163.com>
>> ---
>> drivers/usb/host/xhci-mtk.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
>> index 79959f1..f2365a4 100644
>> --- a/drivers/usb/host/xhci-mtk.c
>> +++ b/drivers/usb/host/xhci-mtk.c
>> @@ -560,8 +560,10 @@ static int xhci_mtk_probe(struct platform_device *pdev)
>> goto disable_ldos;
>>
>> irq = platform_get_irq(pdev, 0);
>> - if (irq < 0)
>> + if (irq < 0) {
>> + ret = irq;
>> goto disable_clk;
>> + }
>>
>> /* Initialize dma_mask and coherent_dma_mask to 32-bits */
>> ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
>>
>
>
> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
>
Thanks, Added to queue
-Mathias
WARNING: multiple messages have this Message-ID (diff)
From: mathias.nyman@linux.intel.com (Mathias Nyman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] usb: return error code when platform_get_irq fails
Date: Wed, 30 Nov 2016 16:05:59 +0200 [thread overview]
Message-ID: <583EDCC7.20702@linux.intel.com> (raw)
In-Reply-To: <52a774c0-9bca-6d1b-a470-f07caefa5d3a@gmail.com>
On 30.11.2016 15:41, Matthias Brugger wrote:
>
>
> On 29/11/16 13:57, Pan Bian wrote:
>> In function xhci_mtk_probe(), variable ret takes the return value. Its
>> value should be negative on failures. However, when the call to function
>> platform_get_irq() fails, it does not set the error code, and 0 will be
>> returned. 0 indicates no error. As a result, the callers of function
>> xhci_mtk_probe() will not be able to detect the error. This patch fixes
>> the bug by assigning the return value of platform_get_irq() to variable
>> ret if it fails.
>>
>> Signed-off-by: Pan Bian <bianpan2016@163.com>
>> ---
>> drivers/usb/host/xhci-mtk.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
>> index 79959f1..f2365a4 100644
>> --- a/drivers/usb/host/xhci-mtk.c
>> +++ b/drivers/usb/host/xhci-mtk.c
>> @@ -560,8 +560,10 @@ static int xhci_mtk_probe(struct platform_device *pdev)
>> goto disable_ldos;
>>
>> irq = platform_get_irq(pdev, 0);
>> - if (irq < 0)
>> + if (irq < 0) {
>> + ret = irq;
>> goto disable_clk;
>> + }
>>
>> /* Initialize dma_mask and coherent_dma_mask to 32-bits */
>> ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
>>
>
>
> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
>
Thanks, Added to queue
-Mathias
next prev parent reply other threads:[~2016-11-30 14:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-29 12:57 [PATCH 1/1] usb: return error code when platform_get_irq fails Pan Bian
[not found] ` <1480424255-25059-1-git-send-email-bianpan2016-9Onoh4P/yGk@public.gmane.org>
2016-11-30 13:41 ` Matthias Brugger
2016-11-30 13:41 ` Matthias Brugger
2016-11-30 13:41 ` Matthias Brugger
2016-11-30 14:05 ` Mathias Nyman [this message]
2016-11-30 14:05 ` Mathias Nyman
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=583EDCC7.20702@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=bianpan2016@163.com \
--cc=chunfeng.yun@mediatek.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=matthias.bgg@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.