linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: iser-target: Add iSCSI Extensions for RDMA (iSER) target driver
@ 2016-01-04 21:07 Dan Carpenter
  2016-01-06 18:24 ` Nicholas A. Bellinger
  2016-01-06 20:20 ` Nicholas A. Bellinger
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2016-01-04 21:07 UTC (permalink / raw)
  To: nab-IzHhD5pYlfBP7FQvKIMDCQ; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hello Nicholas Bellinger,

The patch b8d26b3be8b3: "iser-target: Add iSCSI Extensions for RDMA
(iSER) target driver" from Mar 7, 2013, leads to the following static
checker warning:

	drivers/infiniband/ulp/isert/ib_isert.c:423 isert_device_get()
	error: passing non negative 1 to ERR_PTR

drivers/infiniband/ulp/isert/ib_isert.c
   417  
   418          device->ib_device = cma_id->device;
   419          ret = isert_create_device_ib_res(device);
   420          if (ret) {
   421                  kfree(device);
   422                  mutex_unlock(&device_list_mutex);
   423                  return ERR_PTR(ret);

The warning here is because isert_create_device_ib_res() returns either
a negative error code, zero or one.  The documentation is not clear what
that means.  AHAHAHAHAHAHAHAH.  I joke.  There is no documentation.

Anyway, it's definitely a bug and it leads to a NULL dereference in the
caller.

   424          }
   425  
   426          device->refcount++;
   427          list_add_tail(&device->dev_node, &device_list);
   428          isert_info("Created a new iser device %p refcount %d\n",
   429                     device, device->refcount);
   430          mutex_unlock(&device_list_mutex);
   431  
   432          return device;
   433  }

regards,
dan carpenter
--
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] 5+ messages in thread

end of thread, other threads:[~2016-01-07 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-04 21:07 iser-target: Add iSCSI Extensions for RDMA (iSER) target driver Dan Carpenter
2016-01-06 18:24 ` Nicholas A. Bellinger
     [not found]   ` <1452104665.26125.22.camel-XoQW25Eq2zviZyQQd+hFbcojREIfoBdhmpATvIKMPHk@public.gmane.org>
2016-01-07 15:22     ` Sagi Grimberg
2016-01-06 20:20 ` Nicholas A. Bellinger
2016-01-06 20:22   ` Dan Carpenter

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).