From: Dan Carpenter <error27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Vladimir Sokolovsky
<vlad-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: bug report: dereferencing before check
Date: Mon, 31 May 2010 16:15:52 +0200 [thread overview]
Message-ID: <20100531141552.GW5483@bicker> (raw)
Hello,
I was going through some smatch errors and I was wondering if you could
help me.
drivers/infiniband/hw/mlx4/cq.c +401 mlx4_ib_resize_cq(56)
warn: variable dereferenced before check 'cq->resize_buf'
385 err = mlx4_cq_resize(dev->dev, &cq->mcq, entries, &cq->resize_buf->buf.mtt);
^^^^^^^^^^^^^^^^^^^^^^^^
Dereference "cq->resize_buf" here. (Ok. Technically we
dereference it inside the function).
386 if (err)
387 goto err_buf;
388
389 mlx4_mtt_cleanup(dev->dev, &mtt);
390 if (ibcq->uobject) {
391 cq->buf = cq->resize_buf->buf;
392 cq->ibcq.cqe = cq->resize_buf->cqe;
393 ib_umem_release(cq->umem);
394 cq->umem = cq->resize_umem;
395
396 kfree(cq->resize_buf);
397 cq->resize_buf = NULL;
398 cq->resize_umem = NULL;
399 } else {
400 spin_lock_irq(&cq->lock);
401 if (cq->resize_buf) {
^^^^^^^^^^^^^^
Check here.
402 mlx4_ib_cq_resize_copy_cqes(cq);
Can "cq->resize_buf" be NULL here?
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:[~2010-05-31 14:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-31 14:15 Dan Carpenter [this message]
2010-06-01 3:19 ` bug report: dereferencing before check Roland Dreier
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=20100531141552.GW5483@bicker \
--to=error27-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=vlad-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.