All of lore.kernel.org
 help / color / mirror / Atom feed
From: Moritz Fischer <moritz.fischer.private@gmail.com>
To: Wu Hao <hao.wu@intel.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	Alan Tull <atull@kernel.org>, Kang Luwei <luwei.kang@intel.com>,
	linux-fpga@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] fpga: dfl: fme: fix return value check in in pr_mgmt_init()
Date: Thu, 19 Jul 2018 15:19:07 +0000	[thread overview]
Message-ID: <CAJYdmeP-yWcrhaqEw6bvyxMvtJdQ_7zKZDG4oMKszqWsdNP8AQ@mail.gmail.com> (raw)
In-Reply-To: <20180719134256.GA27234@hao-dev>

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

WARNING: multiple messages have this Message-ID (diff)
From: Moritz Fischer <moritz.fischer.private@gmail.com>
To: Wu Hao <hao.wu@intel.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	Alan Tull <atull@kernel.org>, Kang Luwei <luwei.kang@intel.com>,
	linux-fpga@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] fpga: dfl: fme: fix return value check in in pr_mgmt_init()
Date: Thu, 19 Jul 2018 08:19:07 -0700	[thread overview]
Message-ID: <CAJYdmeP-yWcrhaqEw6bvyxMvtJdQ_7zKZDG4oMKszqWsdNP8AQ@mail.gmail.com> (raw)
In-Reply-To: <20180719134256.GA27234@hao-dev>

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

  reply	other threads:[~2018-07-19 15:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 13:42   ` Wu Hao
2018-07-19 15:19   ` Moritz Fischer [this message]
2018-07-19 15:19     ` Moritz Fischer
2018-07-19 15:28     ` Alan Tull
2018-07-19 15:28       ` Alan Tull

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=CAJYdmeP-yWcrhaqEw6bvyxMvtJdQ_7zKZDG4oMKszqWsdNP8AQ@mail.gmail.com \
    --to=moritz.fischer.private@gmail.com \
    --cc=atull@kernel.org \
    --cc=hao.wu@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=luwei.kang@intel.com \
    --cc=weiyongjun1@huawei.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.