* [PATCH] usnix: correctly handle kzalloc return value
@ 2015-10-17 19:06 Insu Yun
[not found] ` <1445108816-7616-1-git-send-email-wuninsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Insu Yun @ 2015-10-17 19:06 UTC (permalink / raw)
To: umalhi-FYB4Gu1CFyUAvxtiuMwx3w, dledford-H+wXaHxf7aLQT0dZR+AlfA,
sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: taesoo-/4noJB3qBVQ3uPMLIKxrzw,
yeongjin.jang-/4noJB3qBVQ3uPMLIKxrzw, insu-/4noJB3qBVQ3uPMLIKxrzw,
Insu Yun
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>
---
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;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1445108816-7616-1-git-send-email-wuninsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] usnix: correctly handle kzalloc return value [not found] ` <1445108816-7616-1-git-send-email-wuninsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2015-10-19 16:24 ` Dave Goodell 2015-10-21 20:44 ` Doug Ledford 1 sibling, 0 replies; 3+ messages in thread From: Dave Goodell @ 2015-10-19 16:24 UTC (permalink / raw) To: Insu Yun Cc: umalhi-FYB4Gu1CFyUAvxtiuMwx3w, dledford-H+wXaHxf7aLQT0dZR+AlfA, sean.hefty-ral2JQCrhuEAvxtiuMwx3w, hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w, linux-rdma-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, taesoo-/4noJB3qBVQ3uPMLIKxrzw, yeongjin.jang-/4noJB3qBVQ3uPMLIKxrzw, insu-/4noJB3qBVQ3uPMLIKxrzw On Sat, Oct 17, 2015 at 07:06:56PM +0000, 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> > --- > drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) The subject says "usnix" where it should say "usnic". Otherwise: Reviewed-by: Dave Goodell <dgoodell-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> If you have more of these fixes for drivers/infiniband/hw/usnic/, you can send them all through just Doug Ledford and linux-rdma@, no need to copy all of linux-kernel@. You can also CC me instead of Upinder, whose email bounces at this point, though I will see your patches sent to linux-rdma@ even if I'm not explicitly CC-ed. The patch to update MAINTAINERS for usnic has been submitted but hasn't yet percolated somewhere you would have seen it: https://patchwork.kernel.org/patch/7410421/ -Dave -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] usnix: correctly handle kzalloc return value [not found] ` <1445108816-7616-1-git-send-email-wuninsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2015-10-19 16:24 ` Dave Goodell @ 2015-10-21 20:44 ` Doug Ledford 1 sibling, 0 replies; 3+ messages in thread From: Doug Ledford @ 2015-10-21 20:44 UTC (permalink / raw) To: Insu Yun, umalhi-FYB4Gu1CFyUAvxtiuMwx3w, sean.hefty-ral2JQCrhuEAvxtiuMwx3w, hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w, linux-rdma-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Cc: taesoo-/4noJB3qBVQ3uPMLIKxrzw, yeongjin.jang-/4noJB3qBVQ3uPMLIKxrzw, insu-/4noJB3qBVQ3uPMLIKxrzw [-- 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 --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-21 20:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-17 19:06 [PATCH] usnix: correctly handle kzalloc return value Insu Yun
[not found] ` <1445108816-7616-1-git-send-email-wuninsu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-19 16:24 ` Dave Goodell
2015-10-21 20:44 ` Doug Ledford
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).