* [PATCH -next] fpga: dfl: fme: fix return value check in in pr_mgmt_init()
@ 2018-07-19 13:16 Wei Yongjun
2018-07-19 13:42 ` Wu Hao
0 siblings, 1 reply; 4+ messages in thread
From: Wei Yongjun @ 2018-07-19 13:16 UTC (permalink / raw)
To: Wu Hao, Alan Tull, Moritz Fischer, Kang Luwei
Cc: Wei Yongjun, linux-fpga, kernel-janitors
In case of error, the function dfl_fme_create_region() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().
Fixes: 29de76240e86 ("fpga: dfl: fme: add partial reconfiguration sub feature support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/fpga/dfl-fme-pr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fpga/dfl-fme-pr.c b/drivers/fpga/dfl-fme-pr.c
index fc9fd2d..0b84053 100644
--- a/drivers/fpga/dfl-fme-pr.c
+++ b/drivers/fpga/dfl-fme-pr.c
@@ -420,7 +420,7 @@ static int pr_mgmt_init(struct platform_device *pdev,
/* Create region for each port */
fme_region = dfl_fme_create_region(pdata, mgr,
fme_br->br, i);
- if (!fme_region) {
+ if (IS_ERR(fme_region)) {
ret = PTR_ERR(fme_region);
goto destroy_region;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] fpga: dfl: fme: fix return value check in in pr_mgmt_init()
2018-07-19 13:16 [PATCH -next] fpga: dfl: fme: fix return value check in in pr_mgmt_init() Wei Yongjun
@ 2018-07-19 13:42 ` Wu Hao
2018-07-19 15:19 ` Moritz Fischer
0 siblings, 1 reply; 4+ messages in thread
From: Wu Hao @ 2018-07-19 13:42 UTC (permalink / raw)
To: Wei Yongjun
Cc: Alan Tull, Moritz Fischer, Kang Luwei, linux-fpga,
kernel-janitors
On Thu, Jul 19, 2018 at 01:16:54PM +0000, Wei Yongjun wrote:
> In case of error, the function dfl_fme_create_region() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
This is a valid issue, thanks a lot for the fixing.
Hao
>
> Fixes: 29de76240e86 ("fpga: dfl: fme: add partial reconfiguration sub feature support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/fpga/dfl-fme-pr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fpga/dfl-fme-pr.c b/drivers/fpga/dfl-fme-pr.c
> index fc9fd2d..0b84053 100644
> --- a/drivers/fpga/dfl-fme-pr.c
> +++ b/drivers/fpga/dfl-fme-pr.c
> @@ -420,7 +420,7 @@ static int pr_mgmt_init(struct platform_device *pdev,
> /* Create region for each port */
> fme_region = dfl_fme_create_region(pdata, mgr,
> fme_br->br, i);
> - if (!fme_region) {
> + if (IS_ERR(fme_region)) {
> ret = PTR_ERR(fme_region);
> goto destroy_region;
> }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] fpga: dfl: fme: fix return value check in in pr_mgmt_init()
2018-07-19 13:42 ` Wu Hao
@ 2018-07-19 15:19 ` Moritz Fischer
2018-07-19 15:28 ` Alan Tull
0 siblings, 1 reply; 4+ messages in thread
From: Moritz Fischer @ 2018-07-19 15:19 UTC (permalink / raw)
To: Wu Hao; +Cc: Wei Yongjun, Alan Tull, Kang Luwei, linux-fpga, kernel-janitors
On Thu, Jul 19, 2018 at 6:42 AM, Wu Hao <hao.wu@intel.com> wrote:
> On Thu, Jul 19, 2018 at 01:16:54PM +0000, Wei Yongjun wrote:
>> In case of error, the function dfl_fme_create_region() returns ERR_PTR()
>> and never returns NULL. The NULL test in the return value check should
>> be replaced with IS_ERR().
>
> This is a valid issue, thanks a lot for the fixing.
>
> Hao
>
>>
>> Fixes: 29de76240e86 ("fpga: dfl: fme: add partial reconfiguration sub feature support")
>> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Moritz Fischer <mdf@kernel.org>
>> ---
>> drivers/fpga/dfl-fme-pr.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/fpga/dfl-fme-pr.c b/drivers/fpga/dfl-fme-pr.c
>> index fc9fd2d..0b84053 100644
>> --- a/drivers/fpga/dfl-fme-pr.c
>> +++ b/drivers/fpga/dfl-fme-pr.c
>> @@ -420,7 +420,7 @@ static int pr_mgmt_init(struct platform_device *pdev,
>> /* Create region for each port */
>> fme_region = dfl_fme_create_region(pdata, mgr,
>> fme_br->br, i);
>> - if (!fme_region) {
>> + if (IS_ERR(fme_region)) {
>> ret = PTR_ERR(fme_region);
>> goto destroy_region;
>> }
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks,
Moritz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] fpga: dfl: fme: fix return value check in in pr_mgmt_init()
2018-07-19 15:19 ` Moritz Fischer
@ 2018-07-19 15:28 ` Alan Tull
0 siblings, 0 replies; 4+ messages in thread
From: Alan Tull @ 2018-07-19 15:28 UTC (permalink / raw)
To: Moritz Fischer
Cc: Wu Hao, Wei Yongjun, Kang Luwei, linux-fpga, kernel-janitors
On Thu, Jul 19, 2018 at 10:19 AM, Moritz Fischer
<moritz.fischer.private@gmail.com> wrote:
> On Thu, Jul 19, 2018 at 6:42 AM, Wu Hao <hao.wu@intel.com> wrote:
>> On Thu, Jul 19, 2018 at 01:16:54PM +0000, Wei Yongjun wrote:
>>> In case of error, the function dfl_fme_create_region() returns ERR_PTR()
>>> and never returns NULL. The NULL test in the return value check should
>>> be replaced with IS_ERR().
>>
>> This is a valid issue, thanks a lot for the fixing.
>>
>> Hao
>>
>>>
>>> Fixes: 29de76240e86 ("fpga: dfl: fme: add partial reconfiguration sub feature support")
>>> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> Acked-by: Moritz Fischer <mdf@kernel.org>
Acked-by: Alan Tull <atull@kernel.org>
>>> ---
>>> drivers/fpga/dfl-fme-pr.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/fpga/dfl-fme-pr.c b/drivers/fpga/dfl-fme-pr.c
>>> index fc9fd2d..0b84053 100644
>>> --- a/drivers/fpga/dfl-fme-pr.c
>>> +++ b/drivers/fpga/dfl-fme-pr.c
>>> @@ -420,7 +420,7 @@ static int pr_mgmt_init(struct platform_device *pdev,
>>> /* Create region for each port */
>>> fme_region = dfl_fme_create_region(pdata, mgr,
>>> fme_br->br, i);
>>> - if (!fme_region) {
>>> + if (IS_ERR(fme_region)) {
>>> ret = PTR_ERR(fme_region);
>>> goto destroy_region;
>>> }
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> Thanks,
>
> Moritz
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-19 15:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-19 13:16 [PATCH -next] fpga: dfl: fme: fix return value check in in pr_mgmt_init() Wei Yongjun
2018-07-19 13:42 ` Wu Hao
2018-07-19 15:19 ` Moritz Fischer
2018-07-19 15:28 ` Alan Tull
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).