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


Groups > linux.kernel > #1377557 > unrolled thread

[PATCH] drm/nouveau/iccsense: fix ifnullfree.cocci warnings

Started bykbuild test robot <fengguang.wu@intel.com>
First post2016-04-13 09:10 +0200
Last post2016-04-13 12:20 +0200
Articles 3 — 3 participants

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

  [PATCH] drm/nouveau/iccsense: fix ifnullfree.cocci warnings kbuild test robot <fengguang.wu@intel.com> - 2016-04-13 09:10 +0200
    Re: [PATCH] drm/nouveau/iccsense: fix ifnullfree.cocci warnings Martin Peres <martin.peres@free.fr> - 2016-04-13 10:00 +0200
      Re: [PATCH] drm/nouveau/iccsense: fix ifnullfree.cocci warnings Karol Herbst <nouveau@karolherbst.de> - 2016-04-13 12:20 +0200

#1377557 — [PATCH] drm/nouveau/iccsense: fix ifnullfree.cocci warnings

Fromkbuild test robot <fengguang.wu@intel.com>
Date2016-04-13 09:10 +0200
Subject[PATCH] drm/nouveau/iccsense: fix ifnullfree.cocci warnings
Message-ID<rnn62-5Id-3@gated-at.bofh.it>
drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c:133: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: Karol Herbst <nouveau@karolherbst.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
@@ -129,8 +129,7 @@ nvkm_iccsense_dtor(struct nvkm_subdev *s
 {
 	struct nvkm_iccsense *iccsense = nvkm_iccsense(subdev);
 
-	if (iccsense->rails)
-		kfree(iccsense->rails);
+	kfree(iccsense->rails);
 
 	return iccsense;
 }

[toc] | [next] | [standalone]


#1377616

FromMartin Peres <martin.peres@free.fr>
Date2016-04-13 10:00 +0200
Message-ID<rnnSp-69I-7@gated-at.bofh.it>
In reply to#1377557
On 13/04/16 10:07, kbuild test robot wrote:
> drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c:133: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: Karol Herbst <nouveau@karolherbst.de>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Martin Peres <martin.peres@free.fr>

[toc] | [prev] | [next] | [standalone]


#1377736

FromKarol Herbst <nouveau@karolherbst.de>
Date2016-04-13 12:20 +0200
Message-ID<rnq3U-8a8-19@gated-at.bofh.it>
In reply to#1377616

> Martin Peres <martin.peres@free.fr> hat am 13. April 2016 um 09:55
> geschrieben:
> 
> 
> On 13/04/16 10:07, kbuild test robot wrote:
> > drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c:133: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: Karol Herbst <nouveau@karolherbst.de>
> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Karol Herbst <nouveau@karolherbst.de>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web