From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: re: iser-target: Add iSCSI Extensions for RDMA (iSER) target driver
Date: Tue, 5 Jan 2016 00:07:32 +0300 [thread overview]
Message-ID: <20160104210732.GA8675@mwanda> (raw)
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
next reply other threads:[~2016-01-04 21:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-04 21:07 Dan Carpenter [this message]
2016-01-06 18:24 ` iser-target: Add iSCSI Extensions for RDMA (iSER) target driver 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
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=20160104210732.GA8675@mwanda \
--to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nab-IzHhD5pYlfBP7FQvKIMDCQ@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 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).