From: "Steve Wise" <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
To: 'Hariprasad Shenai'
<hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
leedom-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org,
nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Subject: RE: [PATCHv2 for-4.5 1/2] iw_cxgb4: Fixes static checker warning in c4iw_rdev_open()
Date: Tue, 12 Jan 2016 09:55:50 -0600 [thread overview]
Message-ID: <006201d14d51$b5caedc0$2160c940$@opengridcomputing.com> (raw)
In-Reply-To: <1452577477-13490-2-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
> -----Original Message-----
> From: Hariprasad Shenai [mailto:hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org]
> Sent: Monday, January 11, 2016 11:45 PM
> To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org; swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org; leedom-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org; nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org; Hariprasad Shenai
> Subject: [PATCHv2 for-4.5 1/2] iw_cxgb4: Fixes static checker warning in c4iw_rdev_open()
>
> The commit c5dfb000b904 ("iw_cxgb4: Pass qid range to user space
> driver") from Dec 11, 2015, leads to the following static checker
> warning:
>
> drivers/infiniband/hw/cxgb4/device.c:857 c4iw_rdev_open()
> warn: variable dereferenced before check 'rdev->status_page'
> Fixing it.
> Also we weren't deallocating ocqp pool in error path when failed to
> allocate status page. Fixing it too.
>
You need to add:
Fixes: c5dfb000b904 ("iw_cxgb4: Pass qid range to user space driver")
> Reported-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
> ---
> drivers/infiniband/hw/cxgb4/device.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
> index bf15538..2a3490f 100644
> --- a/drivers/infiniband/hw/cxgb4/device.c
> +++ b/drivers/infiniband/hw/cxgb4/device.c
> @@ -850,14 +850,12 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev)
> }
> rdev->status_page = (struct t4_dev_status_page *)
> __get_free_page(GFP_KERNEL);
> + if (!rdev->status_page)
> + goto destroy_ocqp_pool;
> rdev->status_page->qp_start = rdev->lldi.vr->qp.start;
> rdev->status_page->qp_size = rdev->lldi.vr->qp.size;
> rdev->status_page->cq_start = rdev->lldi.vr->cq.start;
> rdev->status_page->cq_size = rdev->lldi.vr->cq.size;
> - if (!rdev->status_page) {
> - pr_err(MOD "error allocating status page\n");
> - goto err4;
> - }
>
> if (c4iw_wr_log) {
> rdev->wr_log = kzalloc((1 << c4iw_wr_log_size_order) *
> @@ -873,6 +871,8 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev)
> rdev->status_page->db_off = 0;
>
> return 0;
> +destroy_ocqp_pool:
> + c4iw_ocqp_pool_destroy(rdev);
> err4:
> c4iw_rqtpool_destroy(rdev);
> err3:
> --
> 2.3.4
--
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 prev parent reply other threads:[~2016-01-12 15:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 5:44 [PATCHv2 for-4.5 0/2] iw_cxgb4: Fixes static checker warnings Hariprasad Shenai
[not found] ` <1452577477-13490-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-01-12 5:44 ` [PATCHv2 for-4.5 1/2] iw_cxgb4: Fixes static checker warning in c4iw_rdev_open() Hariprasad Shenai
[not found] ` <1452577477-13490-2-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-01-12 15:55 ` Steve Wise [this message]
2016-01-12 5:44 ` [PATCHv2 for-4.5 2/2] iw_cxgb4: Fixes GW-Basic labels to meaningful error names Hariprasad Shenai
2016-01-12 7:15 ` [PATCHv2 for-4.5 0/2] iw_cxgb4: Fixes static checker warnings Leon Romanovsky
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='006201d14d51$b5caedc0$2160c940$@opengridcomputing.com' \
--to=swise-7bpotxp6k4+p2yhjcf5u+vpxobypeauw@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=leedom-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nirranjan-ut6Up61K2wZBDgjK7y7TUQ@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).