linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Doug Ledford <dledford@redhat.com>
To: Pan Bian <bianpan201602@163.com>, Steve Wise <swise@chelsio.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	linux-rdma@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Pan Bian <bianpan2016@163.com>
Subject: Re: [PATCH 1/1] infiniband: hw: cxgb4: set errno on failure
Date: Wed, 14 Dec 2016 14:39:53 -0500	[thread overview]
Message-ID: <a14c799c-3b1a-60bf-b34b-e7fa502717b5@redhat.com> (raw)
In-Reply-To: <1480770275-6155-1-git-send-email-bianpan201602@163.com>


[-- Attachment #1.1: Type: text/plain, Size: 1452 bytes --]

On 12/3/2016 8:04 AM, Pan Bian wrote:
> From: Pan Bian <bianpan2016@163.com>
> 
> In function c4iw_rdev_open(), the value of return variable err should be
> negative on errors. However, when the call to __get_free_page() returns
> a NULL pointer, its value is not set to "-ENOMEM" and keeps 0. 0 means
> no error. And thus, the behavior of its caller may be misled. This patch
> fixes the bug.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188821
> 
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
>  drivers/infiniband/hw/cxgb4/device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
> index 93e3d27..b99dc9e 100644
> --- a/drivers/infiniband/hw/cxgb4/device.c
> +++ b/drivers/infiniband/hw/cxgb4/device.c
> @@ -828,8 +828,10 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev)
>  	}
>  	rdev->status_page = (struct t4_dev_status_page *)
>  			    __get_free_page(GFP_KERNEL);
> -	if (!rdev->status_page)
> +	if (!rdev->status_page) {
> +		err = -ENOMEM;
>  		goto destroy_ocqp_pool;
> +	}
>  	rdev->status_page->qp_start = rdev->lldi.vr->qp.start;
>  	rdev->status_page->qp_size = rdev->lldi.vr->qp.size;
>  	rdev->status_page->cq_start = rdev->lldi.vr->cq.start;
> 

This fix was previously submitted by Wei Yongjun.

-- 
Doug Ledford <dledford@redhat.com>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

      parent reply	other threads:[~2016-12-14 19:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-03 13:04 [PATCH 1/1] infiniband: hw: cxgb4: set errno on failure Pan Bian
2016-12-03 13:46 ` Steve Wise
2016-12-14 19:39 ` Doug Ledford [this message]

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=a14c799c-3b1a-60bf-b34b-e7fa502717b5@redhat.com \
    --to=dledford@redhat.com \
    --cc=bianpan201602@163.com \
    --cc=bianpan2016@163.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sean.hefty@intel.com \
    --cc=swise@chelsio.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 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).