* [PATCH] IB/cm: fix device_create() return value check
@ 2010-03-11 16:17 Jani Nikula
[not found] ` <1268324248-30394-1-git-send-email-ext-jani.1.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2010-03-11 16:17 UTC (permalink / raw)
To: rolandd-FYB4Gu1CFyUAvxtiuMwx3w, sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
ext-jani.1.nikula-xNZwKgViW5gAvxtiuMwx3w
From: Jani Nikula <ext-jani.1.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Use IS_ERR() instead of comparing to NULL.
Signed-off-by: Jani Nikula <ext-jani.1.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
---
NOTE: I'm afraid I'm unable to test this; please consider this more a
bug report than a complete patch.
---
drivers/infiniband/core/cm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 764787e..c9730cb 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3693,7 +3693,7 @@ static void cm_add_one(struct ib_device *ib_device)
cm_dev->device = device_create(&cm_class, &ib_device->dev,
MKDEV(0, 0), NULL,
"%s", ib_device->name);
- if (!cm_dev->device) {
+ if (IS_ERR(cm_dev->device)) {
kfree(cm_dev);
return;
}
--
1.6.5.2
--
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: <1268324248-30394-1-git-send-email-ext-jani.1.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>]
* RE: [PATCH] IB/cm: fix device_create() return value check [not found] ` <1268324248-30394-1-git-send-email-ext-jani.1.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org> @ 2010-03-11 16:25 ` Sean Hefty 2010-03-31 21:27 ` Roland Dreier 1 sibling, 0 replies; 3+ messages in thread From: Sean Hefty @ 2010-03-11 16:25 UTC (permalink / raw) To: 'Jani Nikula', rolandd-FYB4Gu1CFyUAvxtiuMwx3w, hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA >From: Jani Nikula <ext-jani.1.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org> > >Use IS_ERR() instead of comparing to NULL. > >Signed-off-by: Jani Nikula <ext-jani.1.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org> > >--- > >NOTE: I'm afraid I'm unable to test this; please consider this more a >bug report than a complete patch. This looks correct to me. Good catch. >--- > drivers/infiniband/core/cm.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > >diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c >index 764787e..c9730cb 100644 >--- a/drivers/infiniband/core/cm.c >+++ b/drivers/infiniband/core/cm.c >@@ -3693,7 +3693,7 @@ static void cm_add_one(struct ib_device *ib_device) > cm_dev->device = device_create(&cm_class, &ib_device->dev, > MKDEV(0, 0), NULL, > "%s", ib_device->name); >- if (!cm_dev->device) { >+ if (IS_ERR(cm_dev->device)) { > kfree(cm_dev); > return; > } >-- >1.6.5.2 -- 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] IB/cm: fix device_create() return value check [not found] ` <1268324248-30394-1-git-send-email-ext-jani.1.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org> 2010-03-11 16:25 ` Sean Hefty @ 2010-03-31 21:27 ` Roland Dreier 1 sibling, 0 replies; 3+ messages in thread From: Roland Dreier @ 2010-03-31 21:27 UTC (permalink / raw) To: Jani Nikula Cc: rolandd-FYB4Gu1CFyUAvxtiuMwx3w, sean.hefty-ral2JQCrhuEAvxtiuMwx3w, hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w, linux-rdma-u79uwXL29TY76Z2rM5mHXA thanks, applied. -- Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> || For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/index.html -- 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
end of thread, other threads:[~2010-03-31 21:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 16:17 [PATCH] IB/cm: fix device_create() return value check Jani Nikula
[not found] ` <1268324248-30394-1-git-send-email-ext-jani.1.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2010-03-11 16:25 ` Sean Hefty
2010-03-31 21:27 ` Roland Dreier
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox