From: Sudeep Dutt <sudeep.dutt@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Sudeep Dutt <sudeep.dutt@intel.com>,
Nikhil Rao <nikhil.rao@intel.com>,
Ashutosh Dixit <ashutosh.dixit@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch 1/2] misc: mic/scif: fix error code in scif_create_remote_lookup()
Date: Sun, 11 Oct 2015 09:14:19 +0000 [thread overview]
Message-ID: <1444554859.93285.232.camel@localhost> (raw)
In-Reply-To: <20151009064122.GC7540@mwanda>
On Fri, 2015-10-09 at 09:41 +0300, Dan Carpenter wrote:
> We should be returning -ENOMEM here instead of success.
>
Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com>
Thanks for the fix!
> Fixes: ba612aa8b487 ('misc: mic: SCIF memory registration and unregistration')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/misc/mic/scif/scif_rma.c b/drivers/misc/mic/scif/scif_rma.c
> index e288996..bc2dccb 100644
> --- a/drivers/misc/mic/scif/scif_rma.c
> +++ b/drivers/misc/mic/scif/scif_rma.c
> @@ -386,16 +386,20 @@ static int scif_create_remote_lookup(struct scif_dev *remote_dev,
> remote_dev, window->nr_lookup *
> sizeof(*window->dma_addr_lookup.lookup),
> GFP_KERNEL | __GFP_ZERO);
> - if (!window->dma_addr_lookup.lookup)
> + if (!window->dma_addr_lookup.lookup) {
> + err = -ENOMEM;
> goto error_window;
> + }
>
> window->num_pages_lookup.lookup > scif_alloc_coherent(&window->num_pages_lookup.offset,
> remote_dev, window->nr_lookup *
> sizeof(*window->num_pages_lookup.lookup),
> GFP_KERNEL | __GFP_ZERO);
> - if (!window->num_pages_lookup.lookup)
> + if (!window->num_pages_lookup.lookup) {
> + err = -ENOMEM;
> goto error_window;
> + }
>
> vmalloc_dma_phys = is_vmalloc_addr(&window->dma_addr[0]);
> vmalloc_num_pages = is_vmalloc_addr(&window->num_pages[0]);
WARNING: multiple messages have this Message-ID (diff)
From: Sudeep Dutt <sudeep.dutt@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Sudeep Dutt <sudeep.dutt@intel.com>,
Nikhil Rao <nikhil.rao@intel.com>,
Ashutosh Dixit <ashutosh.dixit@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch 1/2] misc: mic/scif: fix error code in scif_create_remote_lookup()
Date: Sun, 11 Oct 2015 02:14:19 -0700 [thread overview]
Message-ID: <1444554859.93285.232.camel@localhost> (raw)
In-Reply-To: <20151009064122.GC7540@mwanda>
On Fri, 2015-10-09 at 09:41 +0300, Dan Carpenter wrote:
> We should be returning -ENOMEM here instead of success.
>
Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com>
Thanks for the fix!
> Fixes: ba612aa8b487 ('misc: mic: SCIF memory registration and unregistration')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/misc/mic/scif/scif_rma.c b/drivers/misc/mic/scif/scif_rma.c
> index e288996..bc2dccb 100644
> --- a/drivers/misc/mic/scif/scif_rma.c
> +++ b/drivers/misc/mic/scif/scif_rma.c
> @@ -386,16 +386,20 @@ static int scif_create_remote_lookup(struct scif_dev *remote_dev,
> remote_dev, window->nr_lookup *
> sizeof(*window->dma_addr_lookup.lookup),
> GFP_KERNEL | __GFP_ZERO);
> - if (!window->dma_addr_lookup.lookup)
> + if (!window->dma_addr_lookup.lookup) {
> + err = -ENOMEM;
> goto error_window;
> + }
>
> window->num_pages_lookup.lookup =
> scif_alloc_coherent(&window->num_pages_lookup.offset,
> remote_dev, window->nr_lookup *
> sizeof(*window->num_pages_lookup.lookup),
> GFP_KERNEL | __GFP_ZERO);
> - if (!window->num_pages_lookup.lookup)
> + if (!window->num_pages_lookup.lookup) {
> + err = -ENOMEM;
> goto error_window;
> + }
>
> vmalloc_dma_phys = is_vmalloc_addr(&window->dma_addr[0]);
> vmalloc_num_pages = is_vmalloc_addr(&window->num_pages[0]);
next prev parent reply other threads:[~2015-10-11 9:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 6:41 [patch 1/2] misc: mic/scif: fix error code in scif_create_remote_lookup() Dan Carpenter
2015-10-09 6:41 ` Dan Carpenter
2015-10-11 9:14 ` Sudeep Dutt [this message]
2015-10-11 9:14 ` Sudeep Dutt
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=1444554859.93285.232.camel@localhost \
--to=sudeep.dutt@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nikhil.rao@intel.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.