All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix ifnullfree.cocci warnings
  2015-09-22 17:54 [josef-btrfs:enospc-rework 1/9] fs/btrfs/qgroup.c:1463:2-7: 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 kbuild test robot
@ 2015-09-22 17:54 ` kbuild test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2015-09-22 17:54 UTC (permalink / raw)
  To: Mark Fasheh; +Cc: kbuild-all, Josef Bacik, linux-btrfs

fs/btrfs/qgroup.c:1463:2-7: 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: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1459,8 +1459,7 @@ struct btrfs_qgroup_extent_record *btrfs
 
 void btrfs_qgroup_free_extent_record(struct btrfs_qgroup_extent_record *record)
 {
-	if (record)
-		kfree(record);
+	kfree(record);
 }
 
 struct btrfs_qgroup_extent_record

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [josef-btrfs:enospc-rework 1/9] fs/btrfs/qgroup.c:1463:2-7: 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.
@ 2015-09-22 17:54 kbuild test robot
  2015-09-22 17:54 ` [PATCH] fix ifnullfree.cocci warnings kbuild test robot
  0 siblings, 1 reply; 7+ messages in thread
From: kbuild test robot @ 2015-09-22 17:54 UTC (permalink / raw)
  To: Mark Fasheh; +Cc: kbuild-all, Josef Bacik, linux-btrfs

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git enospc-rework
head:   ea67b575b6cd2be0775ddd1ff66968d11288f2c6
commit: 1aa3e6f33600e899b38591d9da156dfdb37ea325 [1/9] Major qgroup regression in 4.2?


coccinelle warnings: (new ones prefixed by >>)

>> fs/btrfs/qgroup.c:1463:2-7: 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] fix ifnullfree.cocci warnings
  2018-08-14 14:03   ` Mark Brown
  (?)
@ 2018-08-14 14:10   ` Julia Lawall
  -1 siblings, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2018-08-14 14:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: Julia Lawall, Wu Zhigang, kbuild-all, sof-ci-monitor,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Ranjani Sridharan,
	Rander Wang, Pan Xiuli, alsa-devel, linux-kernel



On Tue, 14 Aug 2018, Mark Brown wrote:

> On Tue, Aug 14, 2018 at 12:57:57PM +0200, Julia Lawall wrote:
> > From: kbuild test robot <fengguang.wu@intel.com>
> >
> >  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
> >
> > Fixes: 0099cc17a399 ("ASoC:topology:avoid error log and oops during topology free.")
>
> This doesn't apply against current code, please check and resend (the
> above commit isn't in my tree:
>
> $ git show 0099cc17a399
> fatal: ambiguous argument '0099cc17a399': unknown revision or path not in the working tree.

Sorry, I didn't keep the tree information.

julia

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] fix ifnullfree.cocci warnings
  2018-08-14 10:57 Julia Lawall
@ 2018-08-14 14:03   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2018-08-14 14:03 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Wu Zhigang, kbuild-all, sof-ci-monitor, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, Ranjani Sridharan, Rander Wang,
	Pan Xiuli, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 697 bytes --]

On Tue, Aug 14, 2018 at 12:57:57PM +0200, Julia Lawall wrote:
> From: kbuild test robot <fengguang.wu@intel.com>
> 
>  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
> 
> Fixes: 0099cc17a399 ("ASoC:topology:avoid error log and oops during topology free.")

This doesn't apply against current code, please check and resend (the
above commit isn't in my tree:

$ git show 0099cc17a399
fatal: ambiguous argument '0099cc17a399': unknown revision or path not in the working tree.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] fix ifnullfree.cocci warnings
@ 2018-08-14 14:03   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2018-08-14 14:03 UTC (permalink / raw)
  To: Julia Lawall
  Cc: alsa-devel, Liam Girdwood, Pan Xiuli, Wu Zhigang,
	Ranjani Sridharan, Takashi Iwai, kbuild-all, sof-ci-monitor,
	Rander Wang, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 697 bytes --]

On Tue, Aug 14, 2018 at 12:57:57PM +0200, Julia Lawall wrote:
> From: kbuild test robot <fengguang.wu@intel.com>
> 
>  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
> 
> Fixes: 0099cc17a399 ("ASoC:topology:avoid error log and oops during topology free.")

This doesn't apply against current code, please check and resend (the
above commit isn't in my tree:

$ git show 0099cc17a399
fatal: ambiguous argument '0099cc17a399': unknown revision or path not in the working tree.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] fix ifnullfree.cocci warnings
@ 2018-08-14 10:57 Julia Lawall
  2018-08-14 14:03   ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2018-08-14 10:57 UTC (permalink / raw)
  To: Wu Zhigang
  Cc: kbuild-all, sof-ci-monitor, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Ranjani Sridharan, Rander Wang,
	Pan Xiuli, alsa-devel, linux-kernel

From: kbuild test robot <fengguang.wu@intel.com>

 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

Fixes: 0099cc17a399 ("ASoC:topology:avoid error log and oops during topology free.")
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

Feel free to ignore this if the null test is useful in some way.

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

--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2165,8 +2165,7 @@ void snd_sof_free_topology(struct snd_so
 		/* free sroute and its private data */
 		kfree(sroute->route->source);
 		kfree(sroute->route->sink);
-		if (sroute->route->control)
-			kfree(sroute->route->control);
+		kfree(sroute->route->control);
 		kfree(sroute->route);
 		kfree(sroute->private);
 		kfree(sroute);

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] fix ifnullfree.cocci warnings
  2017-02-13  7:31 [ext4:lazy_journal 31/36] fs/jbd2/jmap.c:19:2-20: 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 kbuild test robot
@ 2017-02-13  7:31 ` kbuild test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2017-02-13  7:31 UTC (permalink / raw)
  To: Abutalib Aghayev; +Cc: kbuild-all, linux-ext4, Theodore Ts'o

fs/jbd2/jmap.c:19:2-20: 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: Abutalib Aghayev <agayev@cs.cmu.edu>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/fs/jbd2/jmap.c
+++ b/fs/jbd2/jmap.c
@@ -15,8 +15,7 @@ int jbd2_journal_init_jmap_cache(void)
 
 void jbd2_journal_destroy_jmap_cache(void)
 {
-	if (jbd2_jmap_cache)
-		kmem_cache_destroy(jbd2_jmap_cache);
+	kmem_cache_destroy(jbd2_jmap_cache);
 	jbd2_jmap_cache = NULL;
 }
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-08-14 14:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-22 17:54 [josef-btrfs:enospc-rework 1/9] fs/btrfs/qgroup.c:1463:2-7: 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 kbuild test robot
2015-09-22 17:54 ` [PATCH] fix ifnullfree.cocci warnings kbuild test robot
2017-02-13  7:31 [ext4:lazy_journal 31/36] fs/jbd2/jmap.c:19:2-20: 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 kbuild test robot
2017-02-13  7:31 ` [PATCH] fix ifnullfree.cocci warnings kbuild test robot
2018-08-14 10:57 Julia Lawall
2018-08-14 14:03 ` Mark Brown
2018-08-14 14:03   ` Mark Brown
2018-08-14 14:10   ` Julia Lawall

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.