From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Insu Yun <wuninsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
umalhi-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: taesoo-/4noJB3qBVQ3uPMLIKxrzw@public.gmane.org,
yeongjin.jang-/4noJB3qBVQ3uPMLIKxrzw@public.gmane.org,
insu-/4noJB3qBVQ3uPMLIKxrzw@public.gmane.org
Subject: Re: [PATCH] usnix: correctly handle kzalloc return value
Date: Wed, 21 Oct 2015 16:44:12 -0400 [thread overview]
Message-ID: <5627F91C.9050102@redhat.com> (raw)
In-Reply-To: <1445108816-7616-1-git-send-email-wuninsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1455 bytes --]
On 10/17/2015 03:06 PM, Insu Yun wrote:
> Since kzalloc returns memory address, not error code,
> it should be checked whether it is null or not.
>
> Signed-off-by: Insu Yun <wuninsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Thanks, applied.
> ---
> drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
> index db3588d..a678a66 100644
> --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
> +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
> @@ -221,8 +221,8 @@ create_roce_custom_flow(struct usnic_ib_qp_grp *qp_grp,
>
> /* Create Flow Handle */
> qp_flow = kzalloc(sizeof(*qp_flow), GFP_ATOMIC);
> - if (IS_ERR_OR_NULL(qp_flow)) {
> - err = qp_flow ? PTR_ERR(qp_flow) : -ENOMEM;
> + if (!qp_flow) {
> + err = -ENOMEM;
> goto out_dealloc_flow;
> }
> qp_flow->flow = flow;
> @@ -296,8 +296,8 @@ create_udp_flow(struct usnic_ib_qp_grp *qp_grp,
>
> /* Create qp_flow */
> qp_flow = kzalloc(sizeof(*qp_flow), GFP_ATOMIC);
> - if (IS_ERR_OR_NULL(qp_flow)) {
> - err = qp_flow ? PTR_ERR(qp_flow) : -ENOMEM;
> + if (!qp_flow) {
> + err = -ENOMEM;
> goto out_dealloc_flow;
> }
> qp_flow->flow = flow;
>
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Doug Ledford <dledford@redhat.com>
To: Insu Yun <wuninsu@gmail.com>,
umalhi@cisco.com, sean.hefty@intel.com, hal.rosenstock@gmail.com,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: taesoo@gatech.edu, yeongjin.jang@gatech.edu, insu@gatech.edu
Subject: Re: [PATCH] usnix: correctly handle kzalloc return value
Date: Wed, 21 Oct 2015 16:44:12 -0400 [thread overview]
Message-ID: <5627F91C.9050102@redhat.com> (raw)
In-Reply-To: <1445108816-7616-1-git-send-email-wuninsu@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1396 bytes --]
On 10/17/2015 03:06 PM, Insu Yun wrote:
> Since kzalloc returns memory address, not error code,
> it should be checked whether it is null or not.
>
> Signed-off-by: Insu Yun <wuninsu@gmail.com>
Thanks, applied.
> ---
> drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
> index db3588d..a678a66 100644
> --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
> +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
> @@ -221,8 +221,8 @@ create_roce_custom_flow(struct usnic_ib_qp_grp *qp_grp,
>
> /* Create Flow Handle */
> qp_flow = kzalloc(sizeof(*qp_flow), GFP_ATOMIC);
> - if (IS_ERR_OR_NULL(qp_flow)) {
> - err = qp_flow ? PTR_ERR(qp_flow) : -ENOMEM;
> + if (!qp_flow) {
> + err = -ENOMEM;
> goto out_dealloc_flow;
> }
> qp_flow->flow = flow;
> @@ -296,8 +296,8 @@ create_udp_flow(struct usnic_ib_qp_grp *qp_grp,
>
> /* Create qp_flow */
> qp_flow = kzalloc(sizeof(*qp_flow), GFP_ATOMIC);
> - if (IS_ERR_OR_NULL(qp_flow)) {
> - err = qp_flow ? PTR_ERR(qp_flow) : -ENOMEM;
> + if (!qp_flow) {
> + err = -ENOMEM;
> goto out_dealloc_flow;
> }
> qp_flow->flow = flow;
>
--
Doug Ledford <dledford@redhat.com>
GPG KeyID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
next prev parent reply other threads:[~2015-10-21 20:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-17 19:06 [PATCH] usnix: correctly handle kzalloc return value Insu Yun
2015-10-17 19:06 ` Insu Yun
[not found] ` <1445108816-7616-1-git-send-email-wuninsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-19 16:24 ` Dave Goodell
2015-10-19 16:24 ` Dave Goodell
2015-10-21 20:44 ` Doug Ledford [this message]
2015-10-21 20:44 ` Doug Ledford
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=5627F91C.9050102@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=insu-/4noJB3qBVQ3uPMLIKxrzw@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=taesoo-/4noJB3qBVQ3uPMLIKxrzw@public.gmane.org \
--cc=umalhi-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=wuninsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=yeongjin.jang-/4noJB3qBVQ3uPMLIKxrzw@public.gmane.org \
/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.