Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1361833 > unrolled thread

Re: [PATCH] rapidio: add RapidIO channelized messaging driver

Started bykbuild test robot <lkp@intel.com>
First post2016-03-21 14:30 +0100
Last post2016-03-21 14:30 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] rapidio: add RapidIO channelized messaging driver kbuild test robot <lkp@intel.com> - 2016-03-21 14:30 +0100
    [PATCH] rapidio: fix ifnullfree.cocci warnings kbuild test robot <lkp@intel.com> - 2016-03-21 14:30 +0100

#1361833 — Re: [PATCH] rapidio: add RapidIO channelized messaging driver

Fromkbuild test robot <lkp@intel.com>
Date2016-03-21 14:30 +0100
SubjectRe: [PATCH] rapidio: add RapidIO channelized messaging driver
Message-ID<rf84c-6fl-45@gated-at.bofh.it>
Hi Alexandre,

[auto build test WARNING on next-20160318]
[cannot apply to v4.5-rc7 v4.5-rc6 v4.5-rc5 v4.5]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Alexandre-Bounine/rapidio-add-RapidIO-channelized-messaging-driver/20160321-195213


coccinelle warnings: (new ones prefixed by >>)

>> drivers/rapidio/rio_cm.c:1401:4-9: 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.
   drivers/rapidio/rio_cm.c:1408:4-9: 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.

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [next] | [standalone]


#1361835 — [PATCH] rapidio: fix ifnullfree.cocci warnings

Fromkbuild test robot <lkp@intel.com>
Date2016-03-21 14:30 +0100
Subject[PATCH] rapidio: fix ifnullfree.cocci warnings
Message-ID<rf84c-6fl-53@gated-at.bofh.it>
In reply to#1361833
drivers/rapidio/rio_cm.c:1401:4-9: 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.
drivers/rapidio/rio_cm.c:1408:4-9: 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: Alexandre Bounine <alexandre.bounine@idt.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 rio_cm.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/rapidio/rio_cm.c
+++ b/drivers/rapidio/rio_cm.c
@@ -1397,15 +1397,15 @@ static void riocm_ch_free(struct kref *r
 
 	if (ch->rx_ring.inuse_cnt) {
 		for (i = 0; i < RIOCM_RX_RING_SIZE; i++) {
-			if (ch->rx_ring.inuse[i] != NULL)
-				kfree(ch->rx_ring.inuse[i]);
+			kfree(ch->rx_ring.inuse[i]);
 		}
 	}
 
 	if (ch->rx_ring.count)
 		for (i = 0; i < RIOCM_RX_RING_SIZE; i++)
-			if (ch->rx_ring.buf[i] != NULL)
-				kfree(ch->rx_ring.buf[i]);
+		{
+			kfree(ch->rx_ring.buf[i]);
+		}
 
 	complete(&ch->comp_close);
 }

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web