public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: kbuild-all-JC7UmRfGjtg@public.gmane.org,
	target-devel
	<target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Bart Van Assche
	<bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>,
	Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>,
	Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Nicholas Bellinger <nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
Subject: [PATCH] ib_srpt: fix ifnullfree.cocci warnings
Date: Tue, 5 Apr 2016 03:11:51 +0800	[thread overview]
Message-ID: <20160404191151.GA173438@lkp-ib04> (raw)
In-Reply-To: <1459794233-19187-1-git-send-email-nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>

drivers/infiniband/ulp/srpt/ib_srpt.c:1987:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

CC: Nicholas Bellinger <nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
Signed-off-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---

 ib_srpt.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1983,8 +1983,7 @@ static void srpt_free_sess_cmd_map_res(s
 		if (!ib_dma_mapping_error(sdev->device, ioctx->ioctx.dma))
 			ib_dma_unmap_single(sdev->device, ioctx->ioctx.dma,
 					    dma_size, DMA_TO_DEVICE);
-		if (ioctx->ioctx.buf)
-			kfree(ioctx->ioctx.buf);
+		kfree(ioctx->ioctx.buf);
 	}
 }
 
--
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

  parent reply	other threads:[~2016-04-04 19:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04 18:23 [PATCH] ib_srpt: Add missing ioctx->buf + ->dma alloc_session_cb init Nicholas A. Bellinger
     [not found] ` <1459794233-19187-1-git-send-email-nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
2016-04-04 18:40   ` Bart Van Assche
     [not found]     ` <5702B503.1060006-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-04-04 22:41       ` Nicholas A. Bellinger
2016-04-04 22:44         ` Bart Van Assche
     [not found]           ` <5702EE56.10503-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-04-04 22:58             ` Nicholas A. Bellinger
2016-04-06 15:31               ` Bart Van Assche
     [not found]                 ` <57052BCB.6070405-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-04-07 22:31                   ` Nicholas A. Bellinger
2016-04-07 22:48                     ` Bart Van Assche
     [not found]                       ` <5706E3BB.70302-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-04-07 23:28                         ` Nicholas A. Bellinger
2016-04-04 19:11   ` kbuild test robot [this message]
2016-04-04 19:11 ` kbuild test robot
     [not found]   ` <201604050303.V0jVrIjf%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-04-04 22:42     ` Nicholas A. Bellinger

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=20160404191151.GA173438@lkp-ib04 \
    --to=lkp-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=kbuild-all-JC7UmRfGjtg@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org \
    --cc=sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org \
    --cc=target-devel-u79uwXL29TY76Z2rM5mHXA@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