mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steve WIse <swise@opengridcomputing.com>
To: Adrian Bunk <bunk@stusta.de>
Cc: Tom Tucker <tom@opengridcomputing.com>,
	openib-general@openib.org, linux-kernel@vger.kernel.org
Subject: Re: infiniband/hw/amso1100/c2_provider.c: possible NULL dereference
Date: Wed, 08 Nov 2006 08:31:47 -0800	[thread overview]
Message-ID: <1163003508.4142.0.camel@linux-q667.site> (raw)
In-Reply-To: <20061108162832.GB4729@stusta.de>


yep.  We'll fix this up asap...


Thanks,


Steve.


On Wed, 2006-11-08 at 17:28 +0100, Adrian Bunk wrote:
> The Coverity checker noted the following in 
> drivers/infiniband/hw/amso1100/c2_provider.c:
> 
> <--  snip  -->
> 
> ...
> int c2_register_device(struct c2_dev *dev)
> {
>         int ret;
>         int i;
> 
>         /* Register pseudo network device */
>         dev->pseudo_netdev = c2_pseudo_netdev_init(dev);
>         if (dev->pseudo_netdev) {
>                 ret = register_netdev(dev->pseudo_netdev);
>                 if (ret) {
>                         printk(KERN_ERR PFX
>                                 "Unable to register netdev, ret = %d\n", ret);
>                         free_netdev(dev->pseudo_netdev);
>                         return ret;
>                 }
>         }
> 
>         pr_debug("%s:%u\n", __FUNCTION__, __LINE__);
>         strlcpy(dev->ibdev.name, "amso%d", IB_DEVICE_NAME_MAX);
>         dev->ibdev.owner = THIS_MODULE;
>         dev->ibdev.uverbs_cmd_mask =
>             (1ull << IB_USER_VERBS_CMD_GET_CONTEXT) |
>             (1ull << IB_USER_VERBS_CMD_QUERY_DEVICE) |
>             (1ull << IB_USER_VERBS_CMD_QUERY_PORT) |
>             (1ull << IB_USER_VERBS_CMD_ALLOC_PD) |
>             (1ull << IB_USER_VERBS_CMD_DEALLOC_PD) |
>             (1ull << IB_USER_VERBS_CMD_REG_MR) |
>             (1ull << IB_USER_VERBS_CMD_DEREG_MR) |
>             (1ull << IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL) |
>             (1ull << IB_USER_VERBS_CMD_CREATE_CQ) |
>             (1ull << IB_USER_VERBS_CMD_DESTROY_CQ) |
>             (1ull << IB_USER_VERBS_CMD_REQ_NOTIFY_CQ) |
>             (1ull << IB_USER_VERBS_CMD_CREATE_QP) |
>             (1ull << IB_USER_VERBS_CMD_MODIFY_QP) |
>             (1ull << IB_USER_VERBS_CMD_POLL_CQ) |
>             (1ull << IB_USER_VERBS_CMD_DESTROY_QP) |
>             (1ull << IB_USER_VERBS_CMD_POST_SEND) |
>             (1ull << IB_USER_VERBS_CMD_POST_RECV);
> 
>         dev->ibdev.node_type = RDMA_NODE_RNIC;
>         memset(&dev->ibdev.node_guid, 0, sizeof(dev->ibdev.node_guid));
>         memcpy(&dev->ibdev.node_guid, dev->pseudo_netdev->dev_addr, 6);
> ...                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> <--  snip  -->
> 
> Above there's an "if (dev->pseudo_netdev)" check, but here it's 
> dereferenced without a check.
> 
> It seems instead of the "if (dev->pseudo_netdev)", there should be some 
> kind of
> 
>   if (!dev->pseudo_netdev)
>   	return -ESOME_ERROR;
> 
> 
> cu
> Adrian
> 


      reply	other threads:[~2006-11-08 16:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08 16:28 Adrian Bunk
2006-11-08 16:31 ` Steve WIse [this message]

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=1163003508.4142.0.camel@linux-q667.site \
    --to=swise@opengridcomputing.com \
    --cc=bunk@stusta.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openib-general@openib.org \
    --cc=tom@opengridcomputing.com \
    /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

all inboxes | Powered by JetHome®